From a2aa51f5702b18016c25d943499941323952704d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 19 Nov 2022 15:52:46 +0100 Subject: Adding upstream version 0.18.0. Signed-off-by: Daniel Baumann --- qa/samples/user_rules/extra/extra_rules.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'qa/samples/user_rules/extra/extra_rules.py') 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 = [ -- cgit v1.2.3