Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions scripts/commit-msg.hook
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ read_commit_message() {
REPLY="${REPLY%%*( )}"
shopt -u extglob

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

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

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

Expand Down
Loading