Skip to content

Commit 8c26dcf

Browse files
committed
ci: ignore commit line limits for signoff lines
In the SignOff custom commit rule, use the original message to check if signoff exists, since the line may be ignored otherwise. Signed-off-by: Pablo Barbáchano <[email protected]>
1 parent 45842cb commit 8c26dcf

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.gitlint

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ line-length=72
66

77
[ignore-body-lines]
88
# Ignore HTTP reference links
9-
regex=^\[.+\]: http.+
9+
# Ignore lines that start with 'Co-Authored-By' or with 'Signed-off-by'
10+
regex=(^\[.+\]: http.+)|(^Co-Authored-By)|(^Signed-off-by)
1011

1112
[ignore-by-author-name]
1213
# Ignore certain rules for commits of which the author name matches a regex

tests/framework/gitlint_rules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def rtn(stmt, i):
100100
co_auth = "Co-authored-by:"
101101
sig = "Signed-off-by:"
102102

103-
message_iter = enumerate(commit.message.body)
103+
message_iter = enumerate(commit.message.original.split("\n"))
104104

105105
# Checks commit message contains a `sig` string
106106
found = False

0 commit comments

Comments
 (0)