diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-11-19 14:52:46 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-11-19 14:52:46 +0000 |
commit | a2aa51f5702b18016c25d943499941323952704d (patch) | |
tree | 7ee43f79639ee53903e7ca389e548974e1497c3a /qa/samples/user_rules | |
parent | Adding upstream version 0.17.0. (diff) | |
download | gitlint-a2aa51f5702b18016c25d943499941323952704d.tar.xz gitlint-a2aa51f5702b18016c25d943499941323952704d.zip |
Adding upstream version 0.18.0.upstream/0.18.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'qa/samples/user_rules')
-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 = [ |