@@ -119,7 +119,7 @@ get_all_match_positions() {
119
119
120
120
# skip if the target is not found
121
121
[ -z " $result " ] && continue
122
-
122
+
123
123
# output and update states
124
124
local line col
125
125
read -r line col <<< " $result"
@@ -250,13 +250,13 @@ validate_commit_message() {
250
250
# ------------------------------------------------------------------------------
251
251
ASPELL=$( which aspell)
252
252
if [ $? -ne 0 ]; then
253
- echo " Aspell not installed - unable to check spelling"
253
+ echo " Aspell not installed - unable to check spelling"
254
254
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
260
260
fi
261
261
262
262
# 1. Separate subject from body with a blank line
@@ -453,7 +453,7 @@ validate_commit_message() {
453
453
FULL_COMMIT_MSG_WITH_SPACE=$( sed ' /^[[:space:]]*#/d' " $COMMIT_MSG_FILE " | \
454
454
sed -E " /$TRAILER_REGEX /d" | sed -E " s@${URL_REGEX# ^} @@g" )
455
455
FULL_COMMIT_MSG=$( echo " $FULL_COMMIT_MSG_WITH_SPACE " | sed ' /^[[:space:]]*$/d' )
456
-
456
+
457
457
# Extended list of abusive words (case-insensitive).
458
458
# Adjust the list as needed.
459
459
ABUSIVE_WORDS_REGEX=' \b(fuck|fucking|dick|shit|bitch|asshole|cunt|motherfucker|damn|crap|dumbass|piss)\b'
@@ -475,7 +475,7 @@ validate_commit_message() {
475
475
-e " s/(['\" ][^'\" ]*['\" ])//g" \
476
476
-e " s/\bcommit[[:space:]]+[0-9a-fA-F]{7,40}\b/commit/g" )
477
477
MSG_FOR_SPELLCHECK=$( echo " $MSG_FOR_SPELLCHECK_LINE_FINDING " | sed ' /^[[:space:]]*$/d' )
478
-
478
+
479
479
# Use aspell to list misspelled words according to American English, ignoring quoted text.
480
480
MISSPELLED_WORDS=$( echo " $MSG_FOR_SPELLCHECK " | $ASPELL --lang=en --list --home-dir=scripts --personal=aspell-pws)
481
481
if [ -n " $MISSPELLED_WORDS " ]; then
@@ -656,8 +656,7 @@ _gen_changeid_input() {
656
656
}
657
657
658
658
_gen_changeid () {
659
- _gen_changeid_input |
660
- git hash-object -t commit --stdin
659
+ _gen_changeid_input | git hash-object -t commit --stdin
661
660
}
662
661
663
662
# It's showtime.
0 commit comments