File: gitlint_config.py

package info (click to toggle)
slurm-wlm 25.05.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 51,772 kB
  • sloc: ansic: 546,579; exp: 61,212; python: 20,435; sh: 10,326; javascript: 6,528; makefile: 4,222; perl: 3,717; pascal: 131
file content (21 lines) | stat: -rw-r--r-- 739 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from gitlint.rules import ConfigurationRule


class IgnoreConfigurationRule(ConfigurationRule):
    """
    This rules allows us to ignore all but the user defined rules for now.
    """

    # A rule MUST have a human friendly name
    name = "ignore-default-configuration-rule"

    # A rule MUST have a *unique* id
    # We recommend starting with UCR (for User-defined Configuration-Rule)
    id = "UCR1"

    def apply(self, config, commit):
        for rule in config.rules:
            self.log.debug(f"rule id:{rule.id} name:{rule.name}")
            if rule.id != "T3" and not rule.id.startswith("UC"):
                self.log.debug(f"ignoring rule id:{rule.id} name:{rule.name}")
                config.ignore.append(rule.name)