Skip to content

Commit

Permalink
Consider umlauts in subject length
Browse files Browse the repository at this point in the history
  • Loading branch information
rockstaedt committed Aug 4, 2023
1 parent 1bab9e4 commit a360b1e
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 @@ -19,7 +19,7 @@ func CreateCommitMessageFrom(messageLines []string) *CommitMessage {
}

func (cm *CommitMessage) ValidateSubject() int {
currentSubjectLength := len(cm.Subject)
currentSubjectLength := len([]rune(cm.Subject))

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 @@ -66,6 +66,7 @@ func TestNewCommitMessage(t *testing.T) {
{"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},
{"I am a commit containing an umlaut ü.................", 3},
}

for _, tc := range testcases {
Expand Down

0 comments on commit a360b1e

Please sign in to comment.