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 298298awk
299299sed
300300changeid
301+ en
302+ msg
Original file line number Diff line number Diff line change @@ -322,13 +322,23 @@ validate_commit_message() {
322322 # 12. Avoid abusive language in commit message content
323323 # ------------------------------------------------------------------------------
324324
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" )
326327 # Extended list of abusive words (case-insensitive).
327328 # Adjust the list as needed.
328329 ABUSIVE_WORDS_REGEX=' \b(fuck|fucking|dick|shit|bitch|asshole|cunt|motherfucker|damn|crap|dumbass|piss)\b'
329330 if echo " $FULL_COMMIT_MSG " | grep -Eiq " $ABUSIVE_WORDS_REGEX " ; then
330331 add_warning 1 " Commit message contains inappropriate language. Avoid using abusive words"
331332 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
332342}
333343
334344unset GREP_OPTIONS
You can’t perform that action at this time.
0 commit comments