Skip to content

Commit

Permalink
Fix false "subject not capitalized" errors (fixes #1)
Browse files Browse the repository at this point in the history
Fix bug that on some environments caused valid commit messages being
reported as having a non-capitalized subject line. For example, subject
line such as "Version bump 1.0.0" was reported as not being capitalized
because the regular expression used a character range [a-z] that on
some systems is interpreted as containing uppercase characters as well
(depends on LC_COLLATE environment variable).
  • Loading branch information
laurivan committed Jun 11, 2024
1 parent b2ed161 commit 9cc5e21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lint-commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ while true; do
# errors that only confuse the user.

# Capitalization check
[[ ${subject} =~ ^[a-z] ]] &&
[[ ${subject} =~ ^[[:lower:]] ]] &&
append_error \
"${error_subject_not_capitalized}" \
"subject${LCM_SUBJECT_LINE_PREFIX_REGEX:+ \"${subject}\"} not capitalized" \
Expand Down

0 comments on commit 9cc5e21

Please sign in to comment.