1
0
Fork 0

Adding upstream version 0.13.1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 05:54:40 +01:00
parent 1805ece79d
commit d8f166e6bb
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
167 changed files with 15302 additions and 0 deletions

View file

@ -0,0 +1,29 @@
from gitlint.rules import CommitRule, RuleViolation
from gitlint.utils import sstr
class GitContextRule(CommitRule):
""" Rule that tests whether we can correctly access certain gitcontext properties """
name = "gitcontext"
id = "UC1"
def validate(self, commit):
violations = [
RuleViolation(self.id, "GitContext.current_branch: {0}".format(commit.context.current_branch), line_nr=1),
RuleViolation(self.id, "GitContext.commentchar: {0}".format(commit.context.commentchar), line_nr=1)
]
return violations
class GitCommitRule(CommitRule):
""" Rule that tests whether we can correctly access certain commit properties """
name = "gitcommit"
id = "UC2"
def validate(self, commit):
violations = [
RuleViolation(self.id, "GitCommit.branches: {0}".format(sstr(commit.branches)), line_nr=1),
]
return violations