File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 5858ERROR=" $( git log \
5959 --no-merges --pretty=format:' %s' " $( git merge-base " ${BRANCH} " HEAD) " ..HEAD | \
6060 while read -r msg; do
61- msg_length=" $( echo " ${msg} " | awk ' {print length($0)}' ) "
61+ ERROR=0
62+ MSG=" "
6263
64+ # Check if the message is too long.
65+ msg_length=" $( echo " ${msg} " | awk ' {print length($0)}' ) "
6366 if [ " ${msg_length} " -gt " ${MSG_MAX_LENGTH} " ]; then
64- ERROR=0
6567 if [ " ${msg_length} " -gt " ${MSG_STRETCH_LENGTH} " ]; then
6668 MSG=" Commit message is longer than ${MSG_STRETCH_LENGTH} characters:"
6769 ERROR=1
@@ -70,6 +72,23 @@ ERROR="$(git log \
7072 MSG=" Commit message is longer than ${MSG_MAX_LENGTH} "
7173 MSG=" ${MSG} (but < ${MSG_STRETCH_LENGTH} ) characters:"
7274 fi
75+ fi
76+
77+ # Check if the message has a colon and if the first colon is followed
78+ # by a space.
79+ if echo " $msg " | grep -q " :" ; then
80+ if ! echo " $msg " | grep -Eq ' ^[^:]*: ' ; then
81+ MSG=" The colon after the area designation is not followed by"
82+ MSG=" ${MSG} a space."
83+ fi
84+ else
85+ MSG=" The commit message is missing a colon after the area"
86+ MSG=" ${MSG} designation."
87+ ERROR=1
88+ echo " error"
89+ fi
90+
91+ if [ -n " ${MSG} " ]; then
7392 if github_annotate_is_on; then
7493 if [ ${ERROR} -eq 1 ]; then
7594 github_annotate_error_no_file " ${MSG} \" ${msg} \" "
You can’t perform that action at this time.
0 commit comments