File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -260,8 +260,6 @@ validate_commit_message() {
260
260
# 7. Use the body to explain what and why vs. how
261
261
# ------------------------------------------------------------------------------
262
262
263
- # ?
264
-
265
263
# 8. Do no write single worded commits
266
264
# ------------------------------------------------------------------------------
267
265
@@ -278,6 +276,13 @@ validate_commit_message() {
278
276
279
277
[[ ${COMMIT_SUBJECT_TO_PROCESS} =~ ^[[:blank:]]+ ]]
280
278
test $? -eq 1 || add_warning 1 " Do not start the subject line with whitespace"
279
+
280
+ # 10. Avoid single word commit messages in subject
281
+ # ------------------------------------------------------------------------------
282
+
283
+ word_count=$( echo " $COMMIT_SUBJECT_TO_PROCESS " | wc -w)
284
+ test " $word_count " -gt 1
285
+ test $? -eq 0 || add_warning 1 " Commit subject should contain more than one word (e.g. 'Update dependencies' instead of 'Update')"
281
286
}
282
287
283
288
unset GREP_OPTIONS
You can’t perform that action at this time.
0 commit comments