Skip to content

Commit bd9ff09

Browse files
Kimmo Saarichristophwitzko
Kimmo Saari
authored andcommitted
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 `: `
1 parent e0458f8 commit bd9ff09

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pkg/analyzer/commit_analyzer.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
var CAVERSION = "dev"
11-
var commitPattern = regexp.MustCompile(`^(\w*)(!)?(?:\((.*)\))?\: (.*)$`)
11+
var commitPattern = regexp.MustCompile(`^(\w*)(?:\((.*)\))?(\!)?\: (.*)$`)
1212
var breakingPattern = regexp.MustCompile("BREAKING CHANGES?")
1313

1414
type DefaultCommitAnalyzer struct{}
@@ -34,8 +34,8 @@ func (da *DefaultCommitAnalyzer) analyzeSingleCommit(rawCommit *semrel.RawCommit
3434
return c
3535
}
3636
c.Type = strings.ToLower(found[0][1])
37-
breakingChange := found[0][2]
38-
c.Scope = found[0][3]
37+
c.Scope = found[0][2]
38+
breakingChange := found[0][3]
3939
c.Message = found[0][4]
4040

4141
isMajorChange := breakingPattern.MatchString(rawCommit.RawMessage)

pkg/analyzer/commit_analyzer_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ func TestDefaultAnalyzer(t *testing.T) {
7171
&semrel.Change{Major: true, Minor: false, Patch: false},
7272
},
7373
{
74-
createRawCommit("g", "refactor!: drop support for Node 6\n\nBREAKING CHANGE: refactor to use JavaScript features not available in Node 6."),
74+
createRawCommit("g", "refactor(parser)!: drop support for Node 6\n\nBREAKING CHANGE: refactor to use JavaScript features not available in Node 6."),
7575
"refactor",
76-
"",
76+
"parser",
7777
&semrel.Change{Major: true, Minor: false, Patch: false},
7878
},
7979
{

0 commit comments

Comments
 (0)