1
0
Fork 0

Adding upstream version 0.15.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 06:02:54 +01:00
parent a06c1515ef
commit d5d4d405a2
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
75 changed files with 1281 additions and 1555 deletions

View file

@ -2,8 +2,6 @@
from gitlint.rules import CommitRule, RuleViolation
from gitlint.options import IntOption, ListOption
from gitlint import utils
"""
Full details on user-defined rules: https://jorisroovers.com/gitlint/user_defined_rules
@ -37,7 +35,7 @@ class BodyMaxLineCount(CommitRule):
line_count = len(commit.message.body)
max_line_count = self.options['max-line-count'].value
if line_count > max_line_count:
message = "Body contains too many lines ({0} > {1})".format(line_count, max_line_count)
message = f"Body contains too many lines ({line_count} > {max_line_count})"
return [RuleViolation(self.id, message, line_nr=1)]
@ -90,8 +88,7 @@ class BranchNamingConventions(CommitRule):
break
if not valid_branch_name:
msg = "Branch name '{0}' does not start with one of {1}".format(branch,
utils.sstr(allowed_branch_prefixes))
msg = f"Branch name '{branch}' does not start with one of {allowed_branch_prefixes}"
violations.append(RuleViolation(self.id, msg, line_nr=1))
return violations

View file

@ -69,4 +69,4 @@ class ReleaseConfigurationRule(ConfigurationRule):
# You can add any extra properties you want to the commit object, these will be available later on
# in all rules.
commit.my_property = u"This is my property"
commit.my_property = "This is my property"

View file

@ -45,7 +45,7 @@ class SpecialChars(LineRule):
# options can be accessed by looking them up by their name in self.options
for char in self.options['special-chars'].value:
if char in line:
msg = "Title contains the special character '{0}'".format(char)
msg = f"Title contains the special character '{char}'"
violation = RuleViolation(self.id, msg, line)
violations.append(violation)