Skip to content

Commit 6a93f2f

Browse files
authored
Merge pull request #291 from lumynou5/aspell/ignore-indented-lines
Ignore spell of indented lines in commit messages
2 parents 16079c8 + ef3fd3b commit 6a93f2f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: scripts/commit-msg.hook

+4-4
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ read_commit_message() {
8585
REPLY="${REPLY%%*( )}"
8686
shopt -u extglob
8787

88-
# ignore comments
89-
[[ $REPLY =~ ^# ]]
88+
# ignore comments and indented lines
89+
[[ $REPLY =~ ^(#|[ ][ ]) ]]
9090
test $? -eq 0 || COMMIT_MSG_LINES+=("$REPLY")
9191

9292
[[ $REPLY =~ "# ------------------------ >8 ------------------------" ]]
@@ -208,7 +208,7 @@ build_commit_trailer_regex() {
208208
TRAILER_REGEX+="$each|"
209209
done
210210
# Remove the trailing pipe, then add a separator and blank space pattern.
211-
TRAILER_REGEX="${TRAILER_REGEX%|})[$separators][[:blank:]]*)"
211+
TRAILER_REGEX="${TRAILER_REGEX%|})[$separators][[:blank:]]*"
212212
fi
213213

214214
# Append standalone trailer keys.
@@ -452,7 +452,7 @@ validate_commit_message() {
452452
candidate="${BASH_REMATCH[2]}"
453453
# Only warn if the candidate filename ends with .c or .h
454454
if [[ "$candidate" =~ \.(c|h)$ ]]; then
455-
add_warning 1 "Avoid using just a filename like '$candidate'. Provide a functional, meaningful description"
455+
add_warning 1 "Avoid using just a filename like '$candidate'. Provide a functional, meaningful description"
456456
fi
457457
fi
458458

0 commit comments

Comments
 (0)