Skip to content

Commit 33f4fa0

Browse files
GeorgeSapkinrobimarko
authored andcommitted
formal: adjust commit subject prefix matching
Base has commits with multiple prefixes in the form of: generic: 6.18: remove obsolete backport patches Adjust the prefix checks to accommodate for it. Signed-off-by: George Sapkin <george@sapk.in>
1 parent 921999c commit 33f4fa0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.github/scripts/check_formalities.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ check_subject() {
110110
# Check subject format
111111
if exclude_weblate && echo "$subject" | grep -iq -e '^Translated using Weblate.*' -e '^Added translation using Weblate.*'; then
112112
status_warn 'Commit subject line exception: authored by Weblate'
113-
elif echo "$subject" | grep -q -e '^[0-9A-Za-z,+/_-]\+: [a-z]' -e '^Revert '; then
113+
elif echo "$subject" | grep -qE -e '^([0-9A-Za-z,+/._-]+: )+[a-z]' -e '^Revert '; then
114114
status_pass 'Commit subject line format seems OK'
115-
elif echo "$subject" | grep -q -e '^[0-9A-Za-z,+/_-]\+: [A-Z]'; then
115+
elif echo "$subject" | grep -qE -e '^([0-9A-Za-z,+/._-]+: )+[A-Z]'; then
116116
output_fail 'First word after prefix in subject should not be capitalized'
117117
RET=1
118-
elif echo "$subject" | grep -q -e '^[0-9A-Za-z,+/_-]\+: '; then
118+
elif echo "$subject" | grep -qE -e '^([0-9A-Za-z,+/._-]+: )+'; then
119119
# Handles cases when there's a prefix but the check for capitalization
120120
# fails (e.g. no word after prefix)
121121
output_fail 'Commit subject line MUST start with `<package name>: ` and be followed by a lower-case word'

0 commit comments

Comments
 (0)