diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-01-25 13:26:08 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-01-25 13:26:08 +0000 |
commit | 3313b4f9c3c5d6a579588e77068ca3ae3edffe2b (patch) | |
tree | 81fccb2a4db79b0de9b0d64701581add3a9a1d21 /examples/my_commit_rules.py | |
parent | Adding upstream version 0.14.0. (diff) | |
download | gitlint-3313b4f9c3c5d6a579588e77068ca3ae3edffe2b.tar.xz gitlint-3313b4f9c3c5d6a579588e77068ca3ae3edffe2b.zip |
Adding upstream version 0.15.0.upstream/0.15.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'examples/my_commit_rules.py')
-rw-r--r-- | examples/my_commit_rules.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/examples/my_commit_rules.py b/examples/my_commit_rules.py index c64008f..5a66c94 100644 --- a/examples/my_commit_rules.py +++ b/examples/my_commit_rules.py @@ -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 |