-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add conventional commit breaking change support
Conventional Commit standard allows for "!" immediately following type and preceding scope to indicate a breaking change. Conform fails against this commit style, so this change allows such commit messages to pass policy check. Signed-off-by: Joey Espinosa <[email protected]>
- Loading branch information
1 parent
0e3a28c
commit c23e2fc
Showing
2 changed files
with
34 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,16 @@ func TestConventionalCommitPolicy(t *testing.T) { | |
CreateCommit: createValidCommit, | ||
ExpectValid: true, | ||
}, | ||
{ | ||
Name: "Breaking", | ||
CreateCommit: createBreakingCommit, | ||
ExpectValid: true, | ||
}, | ||
{ | ||
Name: "InvalidBreaking", | ||
CreateCommit: createInvalidBreakingCommit, | ||
ExpectValid: false, | ||
}, | ||
{ | ||
Name: "Invalid", | ||
CreateCommit: createInvalidCommit, | ||
|
@@ -332,6 +342,18 @@ func createValidCommit() error { | |
return err | ||
} | ||
|
||
func createBreakingCommit() error { | ||
_, err := exec.Command("git", "-c", "user.name='test'", "-c", "user.email='[email protected]'", "commit", "-m", "feat!: description").Output() | ||
|
||
return err | ||
} | ||
|
||
func createInvalidBreakingCommit() error { | ||
_, err := exec.Command("git", "-c", "user.name='test'", "-c", "user.email='[email protected]'", "commit", "-m", "feat$: description").Output() | ||
|
||
return err | ||
} | ||
|
||
func createInvalidCommit() error { | ||
_, err := exec.Command("git", "-c", "user.name='test'", "-c", "user.email='[email protected]'", "commit", "-m", "invalid commit").Output() | ||
|
||
|