Skip to content

Commit a8d4325

Browse files
committed
Warn if commit subject doesn't start with a verb
Change-Id: I80a36763282b273d3381f362fd8220657a458ec3
1 parent 105253f commit a8d4325

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/commit-msg.hook

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,12 @@ validate_commit_message() {
282282
add_warning 1 "Avoid using parentheses '()' in commit subjects"
283283
fi
284284

285+
# 7c. Alert if the commit subject starts with "Implementation"
286+
# ------------------------------------------------------------------------------
287+
if [[ "${COMMIT_SUBJECT_TO_PROCESS}" =~ ^(First|My|Implementation|Creation|Modification) ]]; then
288+
add_warning 1 "Commit subject should use imperative mood"
289+
fi
290+
285291
# 8. Use the body to explain what and why vs. how
286292
# ------------------------------------------------------------------------------
287293

0 commit comments

Comments
 (0)