Skip to content
Snippets Groups Projects
Commit bd9ff099 authored by Kimmo Saari's avatar Kimmo Saari Committed by Christoph Witzko
Browse files

fix: Moved the `!` after the scope

Accidentally added the `!` in the Regex before the Scope. Now it is moved to it's proper place, right after the scope and before the `: `
parent e0458f81
Branches
Tags v1.3.0
No related merge requests found
......@@ -8,7 +8,7 @@ import (
)
var CAVERSION = "dev"
var commitPattern = regexp.MustCompile(`^(\w*)(!)?(?:\((.*)\))?\: (.*)$`)
var commitPattern = regexp.MustCompile(`^(\w*)(?:\((.*)\))?(\!)?\: (.*)$`)
var breakingPattern = regexp.MustCompile("BREAKING CHANGES?")
type DefaultCommitAnalyzer struct{}
......@@ -34,8 +34,8 @@ func (da *DefaultCommitAnalyzer) analyzeSingleCommit(rawCommit *semrel.RawCommit
return c
}
c.Type = strings.ToLower(found[0][1])
breakingChange := found[0][2]
c.Scope = found[0][3]
c.Scope = found[0][2]
breakingChange := found[0][3]
c.Message = found[0][4]
isMajorChange := breakingPattern.MatchString(rawCommit.RawMessage)
......
......@@ -71,9 +71,9 @@ func TestDefaultAnalyzer(t *testing.T) {
&semrel.Change{Major: true, Minor: false, Patch: false},
},
{
createRawCommit("g", "refactor!: drop support for Node 6\n\nBREAKING CHANGE: refactor to use JavaScript features not available in Node 6."),
createRawCommit("g", "refactor(parser)!: drop support for Node 6\n\nBREAKING CHANGE: refactor to use JavaScript features not available in Node 6."),
"refactor",
"",
"parser",
&semrel.Change{Major: true, Minor: false, Patch: false},
},
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment