Skip to content

Commit 21d8fb8

Browse files
committed
gitlint: fix bug in gitlint rules
We would also take into account newlines when checking that lines following co-author are only additional co-authors. Signed-off-by: Diana Popa <dpopa@amazon.com>
1 parent 984d39b commit 21d8fb8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tests/framework/gitlint_rules.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
from gitlint.rules import CommitRule, RuleViolation
66

7-
# Too few public methods (1/2) (too-few-public-methods)
8-
# pylint: disable=R0903
9-
107

118
class EndsSigned(CommitRule):
129
"""Checks commit message body formatting.
@@ -131,13 +128,13 @@ def rtn(stmt, i):
131128
break
132129

133130
return rtn(
134-
(f"Non '{co_auth}' or '{sig}' string found " f"following 1st '{sig}'"),
131+
f"Non '{co_auth}' or '{sig}' string found " f"following 1st '{sig}'",
135132
i,
136133
)
137134

138135
# Checks lines following co-author are only additional co-authors.
139136
for i, line in message_iter:
140-
if not line.startswith(co_auth):
137+
if line and not line.startswith(co_auth):
141138
return rtn(
142139
f"Non '{co_auth}' string found after 1st '{co_auth}'",
143140
i,

0 commit comments

Comments
 (0)