mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
committed by
Rob Bradford
parent
063aa4b7d5
commit
f826d92601
@@ -4,6 +4,30 @@ from gitlint.rules import LineRule, RuleViolation, CommitMessageBody
|
|||||||
import re
|
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):
|
class BodyMaxLineLengthEx(LineRule):
|
||||||
"""A rule to enforce a line limit of 72 characters, except for valid cases."""
|
"""A rule to enforce a line limit of 72 characters, except for valid cases."""
|
||||||
|
|
||||||
@@ -44,6 +68,11 @@ class BodyMaxLineLengthEx(LineRule):
|
|||||||
if is_link:
|
if is_link:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Don't check lines with allowed prefixes
|
||||||
|
for prefix in IGNORE_PREFIXES:
|
||||||
|
if line.startswith(prefix):
|
||||||
|
return None
|
||||||
|
|
||||||
return [
|
return [
|
||||||
RuleViolation(self.id, f"Line '{line}' exceeds limit of {self.max_len}")
|
RuleViolation(self.id, f"Line '{line}' exceeds limit of {self.max_len}")
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user