diff options
Diffstat (limited to 'qa/samples')
-rw-r--r-- | qa/samples/user_rules/extra/extra_rules.py | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/qa/samples/user_rules/extra/extra_rules.py b/qa/samples/user_rules/extra/extra_rules.py index 9a0ae6d..cad531b 100644 --- a/qa/samples/user_rules/extra/extra_rules.py +++ b/qa/samples/user_rules/extra/extra_rules.py @@ -1,25 +1,25 @@ -# -*- coding: utf-8 -*- - from gitlint.rules import CommitRule, RuleViolation, ConfigurationRule from gitlint.options import IntOption, StrOption, ListOption class GitContextRule(CommitRule): - """ Rule that tests whether we can correctly access certain gitcontext properties """ + """Rule that tests whether we can correctly access certain gitcontext properties""" + name = "gïtcontext" id = "UC1" def validate(self, commit): violations = [ RuleViolation(self.id, f"GitContext.current_branch: {commit.context.current_branch}", line_nr=1), - RuleViolation(self.id, f"GitContext.commentchar: {commit.context.commentchar}", line_nr=1) + RuleViolation(self.id, f"GitContext.commentchar: {commit.context.commentchar}", line_nr=1), ] return violations class GitCommitRule(CommitRule): - """ Rule that tests whether we can correctly access certain commit properties """ + """Rule that tests whether we can correctly access certain commit properties""" + name = "gïtcommit" id = "UC2" @@ -33,7 +33,8 @@ class GitCommitRule(CommitRule): class GitlintConfigurationRule(ConfigurationRule): - """ Rule that tests whether we can correctly access the config as well as modify the commit message """ + """Rule that tests whether we can correctly access the config as well as modify the commit message""" + name = "cönfigrule" id = "UC3" @@ -50,13 +51,16 @@ class GitlintConfigurationRule(ConfigurationRule): class ConfigurableCommitRule(CommitRule): - """ Rule that tests that we can add configuration to user-defined rules """ + """Rule that tests that we can add configuration to user-defined rules""" + name = "configürable" id = "UC4" - options_spec = [IntOption("int-öption", 2, "int-öption description"), - StrOption("str-öption", "föo", "int-öption description"), - ListOption("list-öption", ["foo", "bar"], "list-öption description")] + options_spec = [ + IntOption("int-öption", 2, "int-öption description"), + StrOption("str-öption", "föo", "int-öption description"), + ListOption("list-öption", ["foo", "bar"], "list-öption description"), + ] def validate(self, _): violations = [ |