Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions scripts/commit-msg.hook
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,11 @@ validate_commit_message() {
# 11. Avoid commit subject that simply states a file update (e.g. "Update console.c")
# ------------------------------------------------------------------------------

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

Expand Down