Skip to content

Commit 0770f78

Browse files
committed
Provide more verbs for checking commit message
The commit e4ad8ec was limited to the subject starting with "Update," and the checker captures additional verbs like "Fix" and "Improve." Change-Id: I8f155ec1a8a6277272cf32c541ada1d182b82501
1 parent de3b2ca commit 0770f78

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)