Skip to content

Commit 66af7a6

Browse files
nashifaescolar
authored andcommittedApr 10, 2024
gitlint: do not allow treewide as an area in commit messages
Treewide changes touching a single area or topic should have the area/subsystem at the start of the commit message. Treewide is very ambigous. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
1 parent b9f3d68 commit 66af7a6

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed
 

‎.gitlint

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ extra-path=scripts/gitlint
2626
# max-line-count=200
2727

2828
[title-starts-with-subsystem]
29-
regex = ^(?!subsys:)(([^:]+):)(\s([^:]+):)*\s(.+)$
29+
regex = ^(?!subsys:)(?!treewide:)(([^:]+):)(\s([^:]+):)*\s(.+)$
3030

3131
[title-must-not-contain-word]
3232
# Comma-separated list of words that should not occur in the title. Matching is case

‎scripts/ci/twister_ignore.txt

+1
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ scripts/checkpatch.pl
4545
scripts/ci/pylintrc
4646
scripts/footprint/*
4747
scripts/set_assignees.py
48+
scripts/gitlint/zephyr_commit_rules.py

‎scripts/gitlint/zephyr_commit_rules.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class TitleStartsWithSubsystem(LineRule):
9595
def validate(self, title, _commit):
9696
regex = self.options['regex'].value
9797
pattern = re.compile(regex, re.UNICODE)
98-
violation_message = "Commit title does not follow [subsystem]: [subject] (and should not start with literal subsys:)"
98+
violation_message = "Commit title does not follow [subsystem]: [subject] (and should not start with literal subsys or treewide)"
9999
if not pattern.search(title):
100100
return [RuleViolation(self.id, violation_message, title)]
101101

0 commit comments

Comments
 (0)
Please sign in to comment.