Coverage for src / python_commitlint / core / enums.py: 100%

17 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-04-28 02:54 +0000

1"""Enumerations shared across the linter, parser, rules, and configuration.""" 

2 

3from enum import StrEnum 

4 

5 

6class Severity(StrEnum): 

7 """How a rule violation is reported. 

8 

9 ``DISABLED`` rules are skipped entirely. ``WARNING`` violations do not 

10 fail the lint; ``ERROR`` violations do. 

11 """ 

12 

13 DISABLED = "disabled" 

14 WARNING = "warning" 

15 ERROR = "error" 

16 

17 

18class RuleCondition(StrEnum): 

19 """The polarity of a rule's expectation. 

20 

21 ``ALWAYS`` means the rule's check must hold; ``NEVER`` means it must 

22 not. For example, ``subject-full-stop`` with ``NEVER`` forbids a 

23 trailing period on the subject. 

24 """ 

25 

26 ALWAYS = "always" 

27 NEVER = "never" 

28 

29 

30class CaseType(StrEnum): 

31 """Recognized case styles for commit message components.""" 

32 

33 LOWER_CASE = "lower-case" 

34 UPPER_CASE = "upper-case" 

35 CAMEL_CASE = "camel-case" 

36 KEBAB_CASE = "kebab-case" 

37 PASCAL_CASE = "pascal-case" 

38 SENTENCE_CASE = "sentence-case" 

39 SNAKE_CASE = "snake-case" 

40 START_CASE = "start-case"