summaryrefslogtreecommitdiffstats
path: root/docs/user_defined_rules.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/user_defined_rules.md')
-rw-r--r--docs/user_defined_rules.md7
1 files changed, 3 insertions, 4 deletions
diff --git a/docs/user_defined_rules.md b/docs/user_defined_rules.md
index 13ea544..fd944d1 100644
--- a/docs/user_defined_rules.md
+++ b/docs/user_defined_rules.md
@@ -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