You've already forked go-semantic-release
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1bc0185f70 | ||
|
|
f0ebb03e46 |
@@ -22,7 +22,7 @@ const ANGULAR = "angular"
|
||||
|
||||
func newAngular() *angular {
|
||||
return &angular{
|
||||
regex: `^(TAG)(?:\((.*)\))?: (.*)`,
|
||||
regex: `^(TAG)(?:\((.*)\))?: (?s)(.*)`,
|
||||
log: log.WithField("analyzer", ANGULAR),
|
||||
rules: []Rule{
|
||||
{
|
||||
@@ -105,8 +105,8 @@ func (a *angular) analyze(commit shared.Commit, rule Rule) (shared.AnalyzedCommi
|
||||
}
|
||||
breakingChange := strings.SplitN(message, "BREAKING CHANGE:", 2)
|
||||
|
||||
analyzed.ParsedMessage = strings.Trim(breakingChange[0], " ")
|
||||
analyzed.ParsedBreakingChangeMessage = strings.Trim(breakingChange[1], " ")
|
||||
analyzed.ParsedMessage = strings.TrimSpace(breakingChange[0])
|
||||
analyzed.ParsedBreakingChangeMessage = strings.TrimSpace(breakingChange[1])
|
||||
|
||||
a.log.Tracef(" %s, BREAKING CHANGE found", commit.Message)
|
||||
return analyzed, true, nil
|
||||
|
||||
@@ -93,6 +93,53 @@ func TestAngular(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{ testCase: "feat breaking change footer",
|
||||
commits: []shared.Commit{
|
||||
shared.Commit{
|
||||
Message: "feat(internal/changelog): my first commit",
|
||||
Author: "me",
|
||||
Hash: "12345667",
|
||||
},
|
||||
shared.Commit{
|
||||
Message: "feat(internal/changelog): my first break \n\nBREAKING CHANGE: change api to v2\n",
|
||||
Author: "me",
|
||||
Hash: "12345668",
|
||||
},
|
||||
},
|
||||
analyzedCommits: map[shared.Release][]shared.AnalyzedCommit{
|
||||
"minor": []shared.AnalyzedCommit{
|
||||
shared.AnalyzedCommit{
|
||||
Commit: shared.Commit{
|
||||
Message: "feat(internal/changelog): my first commit",
|
||||
Author: "me",
|
||||
Hash: "12345667",
|
||||
},
|
||||
Scope: "internal/changelog",
|
||||
ParsedMessage: "my first commit",
|
||||
Tag: "feat",
|
||||
TagString: "Features",
|
||||
Print: true,
|
||||
},
|
||||
},
|
||||
"major": []shared.AnalyzedCommit{
|
||||
shared.AnalyzedCommit{
|
||||
Commit: shared.Commit{
|
||||
Message: "feat(internal/changelog): my first break \n\nBREAKING CHANGE: change api to v2\n",
|
||||
Author: "me",
|
||||
Hash: "12345668",
|
||||
},
|
||||
Scope: "internal/changelog",
|
||||
ParsedMessage: "my first break",
|
||||
Tag: "feat",
|
||||
TagString: "Features",
|
||||
Print: true,
|
||||
ParsedBreakingChangeMessage: "change api to v2",
|
||||
},
|
||||
},
|
||||
"patch": []shared.AnalyzedCommit{},
|
||||
"none": []shared.AnalyzedCommit{},
|
||||
},
|
||||
},
|
||||
{
|
||||
testCase: "invalid",
|
||||
analyzedCommits: map[shared.Release][]shared.AnalyzedCommit{
|
||||
|
||||
Reference in New Issue
Block a user