Skip to content

Commit c051686

Browse files
authored
Merge pull request #201 from sysprog21/refine-commit-message
Provide more verbs for checking commit message
2 parents dac4fdf + 0770f78 commit c051686

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/commit-msg.hook

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,11 @@ validate_commit_message() {
314314
# 11. Avoid commit subject that simply states a file update (e.g. "Update console.c")
315315
# ------------------------------------------------------------------------------
316316

317-
if [[ ${COMMIT_SUBJECT_TO_PROCESS} =~ ^Update[[:space:]]+([^[:space:]]+)$ ]]; then
318-
candidate="${BASH_REMATCH[1]}"
317+
if [[ "$COMMIT_SUBJECT_TO_PROCESS" =~ ^(Update|Modify|Change|Fix|Refine|Improve|Revise)[[:space:]]+([^[:space:]]+)$ ]]; then
318+
candidate="${BASH_REMATCH[2]}"
319319
# Only warn if the candidate filename ends with .c or .h
320-
if [[ $candidate =~ \.(c|h)$ ]]; then
321-
add_warning 1 "Avoid using just a filename like '$candidate'. Provide a functional, meaningful description"
320+
if [[ "$candidate" =~ \.(c|h)$ ]]; then
321+
add_warning 1 "Avoid using just a filename like '$candidate'. Provide a functional, meaningful description"
322322
fi
323323
fi
324324

0 commit comments

Comments
 (0)