misc: gitlint: allow well-known commit tags to exceed line limit

To get that list, I've used

```
git log | grep --fixed-strings -- "-by:" | head -n 100000 | sort | less
```

on the Linux kernel's git repository.

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
Philipp Schuster 2025-11-13 13:24:19 +01:00 committed by Rob Bradford
parent 063aa4b7d5
commit f826d92601

View file

@ -4,6 +4,30 @@ from gitlint.rules import LineRule, RuleViolation, CommitMessageBody
import re
IGNORE_PREFIXES = [
# Please sort alphabetically
"Acked-by: ",
"Co-authored-by: ",
"Co-developed-by: ",
"Debugged-by: ",
"Diagnosed-by: ",
"Explained-by: ",
"Fixed-by: ",
"Fixes: ",
"Helped-by: ",
"Inspired-by: ",
"On-behalf-of: ",
"Originally-by: ",
"Reported-by: ",
"Reviewed-and-tested-by: ",
"Reviewed-by: ",
"Signed-off-by: ",
"Suggested-by: ",
"Tested-by: ",
"Triggered-by: ",
]
class BodyMaxLineLengthEx(LineRule):
"""A rule to enforce a line limit of 72 characters, except for valid cases."""
@ -44,6 +68,11 @@ class BodyMaxLineLengthEx(LineRule):
if is_link:
return
# Don't check lines with allowed prefixes
for prefix in IGNORE_PREFIXES:
if line.startswith(prefix):
return None
return [
RuleViolation(self.id, f"Line '{line}' exceeds limit of {self.max_len}")
]