From 4fee3e091a8d79a40f70ff9c1f87b29b9340049a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 25 Jan 2021 14:26:11 +0100 Subject: Merging upstream version 0.15.0. Signed-off-by: Daniel Baumann --- docs/user_defined_rules.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'docs/user_defined_rules.md') 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 -- cgit v1.2.3