From 42db468ef576dd338bb11e636f7a33c11b0ce490 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Wed, 14 Sep 2022 22:48:54 +0200 Subject: [PATCH] Meta: Revise lint-commit.sh regex for the title This mainly changes two aspects: - The category can now be a single letter, such as 'w' to indicate the file Utilities/w.cpp - Spaces in the category (or list) are no longer allowed. This follows the lived practice of writing category lists as "Foo+Bar: Quux" Closes #15243. --- Meta/lint-commit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Meta/lint-commit.sh b/Meta/lint-commit.sh index d6e0887403..5e04e11c64 100755 --- a/Meta/lint-commit.sh +++ b/Meta/lint-commit.sh @@ -34,7 +34,7 @@ while read -r line; do error "Empty line between commit title and body is missing" fi - category_pattern="^\S.*?\S: .+" + category_pattern='^(Revert "|\S+: )' if [[ $line_number -eq 1 ]] && (echo "$line" | grep -E -v -q "$category_pattern"); then error "Missing category in commit title (if this is a fix up of a previous commit, it should be squashed)" fi