@@ -119,7 +119,7 @@ get_all_match_positions() {
119119
120120 # skip if the target is not found
121121 [ -z " $result " ] && continue
122-
122+
123123 # output and update states
124124 local line col
125125 read -r line col <<< " $result"
@@ -250,13 +250,13 @@ validate_commit_message() {
250250 # ------------------------------------------------------------------------------
251251 ASPELL=$( which aspell)
252252 if [ $? -ne 0 ]; then
253- echo " Aspell not installed - unable to check spelling"
253+ echo " Aspell not installed - unable to check spelling"
254254 else
255- LINE_NUMBER=1
256- MISSPELLED_WORDS=$( echo " $COMMIT_MSG_LINES [LINE_NUMBER]" | $ASPELL --lang=en --list --home-dir=scripts --personal=aspell-pws)
257- if [ -n " $MISSPELLED_WORDS " ]; then
258- add_warning LINE_NUMBER " Possible misspelled word(s): $MISSPELLED_WORDS "
259- fi
255+ LINE_NUMBER=1
256+ MISSPELLED_WORDS=$( echo " $COMMIT_MSG_LINES [LINE_NUMBER]" | $ASPELL --lang=en --list --home-dir=scripts --personal=aspell-pws)
257+ if [ -n " $MISSPELLED_WORDS " ]; then
258+ add_warning LINE_NUMBER " Possible misspelled word(s): $MISSPELLED_WORDS "
259+ fi
260260 fi
261261
262262 # 1. Separate subject from body with a blank line
@@ -453,7 +453,7 @@ validate_commit_message() {
453453 FULL_COMMIT_MSG_WITH_SPACE=$( sed ' /^[[:space:]]*#/d' " $COMMIT_MSG_FILE " | \
454454 sed -E " /$TRAILER_REGEX /d" | sed -E " s@${URL_REGEX# ^} @@g" )
455455 FULL_COMMIT_MSG=$( echo " $FULL_COMMIT_MSG_WITH_SPACE " | sed ' /^[[:space:]]*$/d' )
456-
456+
457457 # Extended list of abusive words (case-insensitive).
458458 # Adjust the list as needed.
459459 ABUSIVE_WORDS_REGEX=' \b(fuck|fucking|dick|shit|bitch|asshole|cunt|motherfucker|damn|crap|dumbass|piss)\b'
@@ -475,7 +475,7 @@ validate_commit_message() {
475475 -e " s/(['\" ][^'\" ]*['\" ])//g" \
476476 -e " s/\bcommit[[:space:]]+[0-9a-fA-F]{7,40}\b/commit/g" )
477477 MSG_FOR_SPELLCHECK=$( echo " $MSG_FOR_SPELLCHECK_LINE_FINDING " | sed ' /^[[:space:]]*$/d' )
478-
478+
479479 # Use aspell to list misspelled words according to American English, ignoring quoted text.
480480 MISSPELLED_WORDS=$( echo " $MSG_FOR_SPELLCHECK " | $ASPELL --lang=en --list --home-dir=scripts --personal=aspell-pws)
481481 if [ -n " $MISSPELLED_WORDS " ]; then
@@ -656,8 +656,7 @@ _gen_changeid_input() {
656656}
657657
658658_gen_changeid () {
659- _gen_changeid_input |
660- git hash-object -t commit --stdin
659+ _gen_changeid_input | git hash-object -t commit --stdin
661660}
662661
663662# It's showtime.
0 commit comments