Skip to content

Commit

Permalink
fix: Moved the ! after the scope
Browse files Browse the repository at this point in the history
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 `: `
  • Loading branch information
Kimmo Saari authored and christophwitzko committed Oct 27, 2020
1 parent e0458f8 commit bd9ff09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkg/analyzer/commit_analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pkg/analyzer/commit_analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
},
{
Expand Down

0 comments on commit bd9ff09

Please sign in to comment.