From 7c4e7d8c7b6ce7a7ec2d7fc91466a876c10363d2 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Mon, 20 May 2024 16:55:51 +0200 Subject: [PATCH] ci/lint: allow the first word after : to be an option with -- --- ci/lint-commit-msg.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ci/lint-commit-msg.py b/ci/lint-commit-msg.py index 68e3b43a42..25341b48a0 100755 --- a/ci/lint-commit-msg.py +++ b/ci/lint-commit-msg.py @@ -74,12 +74,9 @@ def subsystem_prefix(body): @lint_rule("First word after : must be lower case") def description_lowercase(body): - if re.search(NO_PREFIX_WHITELIST, body[0]): - return True - # Allow all caps for acronyms and such - if re.search(r": [A-Z]{2,} ", body[0]): - return True - return re.search(r": [a-z0-9]", body[0]) + # Allow all caps for acronyms and options with -- + return (re.search(NO_PREFIX_WHITELIST, body[0]) or + re.search(r": (?:[A-Z]{2,} |--[a-z]|[a-z0-9])", body[0])) @lint_rule("Subject line must not end with a full stop") def no_dot(body):