1
0
Fork 0

Merging upstream version 0.15.0.

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

View file

@ -152,7 +152,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)
@ -262,8 +262,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)]
```
@ -371,7 +370,7 @@ 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"
```
For all available properties and methods on the `config` object, have a look at the