Skip to content

Commit

Permalink
Merge pull request #29 from rockstaedt/28-exclude-merge-branch-commits
Browse files Browse the repository at this point in the history
Ignore validation for branch merge commits
  • Loading branch information
rockstaedt authored Feb 15, 2023
2 parents 10945f6 + 8961ac4 commit 13df56a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/model/commit_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func CreateCommitMessageFrom(messageLines []string) *CommitMessage {
func (cm *CommitMessage) ValidateSubject() int {
currentSubjectLength := len(cm.Subject)

if strings.HasPrefix(cm.Subject, "Merge pull request") {
if strings.HasPrefix(cm.Subject, "Merge ") {
return 0
}

Expand Down
1 change: 1 addition & 0 deletions internal/model/commit_message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func TestNewCommitMessage(t *testing.T) {
{"#1301 - more than........50..............through ID prefix", 0},
{"short subject line", 0},
{"Merge pull request commits are ignored because they can easily exceed 52 characters", 0},
{"Merge branch commits are also ignored..............................................", 0},
}

for _, tc := range testcases {
Expand Down

0 comments on commit 13df56a

Please sign in to comment.