Skip to content

Commit 921999c

Browse files
GeorgeSapkinrobimarko
authored andcommitted
formal: improve messaging
Make commit subject line length check message clearer by specifying both soft and hard limits. Signed-off-by: George Sapkin <george@sapk.in>
1 parent 13c6181 commit 921999c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/scripts/check_formalities.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,16 @@ check_subject() {
140140
# Check subject length first for hard limit which results in an error and
141141
# otherwise for a soft limit which results in a warning. Show soft limit in
142142
# either case.
143+
local msg="Commit subject length: recommended max $MAX_SUBJECT_LEN_SOFT, required max $MAX_SUBJECT_LEN_HARD characters"
143144
if [ ${#subject} -gt "$MAX_SUBJECT_LEN_HARD" ]; then
144-
output_fail "Commit subject line is longer than $MAX_SUBJECT_LEN_SOFT characters (is ${#subject})"
145+
output_fail "$msg"
145146
split_fail "$MAX_SUBJECT_LEN_SOFT" "$subject"
146147
RET=1
147148
elif [ ${#subject} -gt "$MAX_SUBJECT_LEN_SOFT" ]; then
148-
output_warn "Commit subject line is longer than $MAX_SUBJECT_LEN_SOFT characters (is ${#subject})"
149+
output_warn "$msg"
149150
split_fail "$MAX_SUBJECT_LEN_SOFT" "$subject"
150151
else
151-
status_pass "Commit subject line is $MAX_SUBJECT_LEN_SOFT characters or less"
152+
status_pass "$msg"
152153
fi
153154
}
154155

0 commit comments

Comments
 (0)