diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/my_commit_rules.py | 4 | ||||
-rw-r--r-- | examples/my_line_rules.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/my_commit_rules.py b/examples/my_commit_rules.py index 5e8ce08..5a66c94 100644 --- a/examples/my_commit_rules.py +++ b/examples/my_commit_rules.py @@ -35,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)] @@ -88,7 +88,7 @@ class BranchNamingConventions(CommitRule): break if not valid_branch_name: - msg = "Branch name '{0}' does not start with one of {1}".format(branch, 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 diff --git a/examples/my_line_rules.py b/examples/my_line_rules.py index 820024a..3a1ef36 100644 --- a/examples/my_line_rules.py +++ b/examples/my_line_rules.py @@ -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) |