File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 298
298
awk
299
299
sed
300
300
changeid
301
+ en
302
+ msg
Original file line number Diff line number Diff line change @@ -322,13 +322,23 @@ validate_commit_message() {
322
322
# 12. Avoid abusive language in commit message content
323
323
# ------------------------------------------------------------------------------
324
324
325
- FULL_COMMIT_MSG=$( sed ' /^#/d;/^[[:space:]]*$/d' " $COMMIT_MSG_FILE " )
325
+ FULL_COMMIT_MSG=$( sed ' /^#/d;/^[[:space:]]*$/d;/^[[:space:]]*Change-Id:/d' " $COMMIT_MSG_FILE " | \
326
+ sed -E " s@${URL_REGEX# ^} @@g" )
326
327
# Extended list of abusive words (case-insensitive).
327
328
# Adjust the list as needed.
328
329
ABUSIVE_WORDS_REGEX=' \b(fuck|fucking|dick|shit|bitch|asshole|cunt|motherfucker|damn|crap|dumbass|piss)\b'
329
330
if echo " $FULL_COMMIT_MSG " | grep -Eiq " $ABUSIVE_WORDS_REGEX " ; then
330
331
add_warning 1 " Commit message contains inappropriate language. Avoid using abusive words"
331
332
fi
333
+
334
+ # 13. Always use American English.
335
+ # ------------------------------------------------------------------------------
336
+
337
+ # Use aspell to list misspelled words according to American English.
338
+ MISSPELLED_WORDS=$( echo " $FULL_COMMIT_MSG " | $ASPELL --lang=en --list --home-dir=scripts --personal=aspell-pws)
339
+ if [ -n " $MISSPELLED_WORDS " ]; then
340
+ add_warning 1 " Avoid using non-American English words"
341
+ fi
332
342
}
333
343
334
344
unset GREP_OPTIONS
You can’t perform that action at this time.
0 commit comments