blob: 2f71b6de444738708c74d7ca9eab415a651c4e62 [file] [log] [blame]
from gitlint.rules import CommitRule, RuleViolation
class DuplicateChangeIdEntries(CommitRule):
name = "duplicate-change-id-entries"
id = "UC2"
def validate(self, commit):
change_ids = [
x for x in commit.message.body if x.startswith("Change-Id:")
]
if len(change_ids) > 1:
return [
RuleViolation(
self.id,
"Multiple Change-Ids found in commit message body",
change_ids,
)
]
return None