summaryrefslogtreecommitdiffstats
path: root/qa/samples
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-19 14:52:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-19 14:53:01 +0000
commitf3b6c222fb11c96e2f8bbaa0622f46c8ec486874 (patch)
tree0f38497775e27d3e16b20573b36dd22aa5b24f3e /qa/samples
parentReleasing debian version 0.17.0-1. (diff)
downloadgitlint-f3b6c222fb11c96e2f8bbaa0622f46c8ec486874.tar.xz
gitlint-f3b6c222fb11c96e2f8bbaa0622f46c8ec486874.zip
Merging upstream version 0.18.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'qa/samples')
-rw-r--r--qa/samples/user_rules/extra/extra_rules.py24
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 = [