Skip to content

Commit db8e93a

Browse files
committed
docs(bump_rule): add docstring
1 parent 5e81873 commit db8e93a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

commitizen/bump_rule.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010

1111

1212
class SemVerIncrement(Enum):
13+
"""An enumeration representing semantic versioning increments.
14+
15+
This class defines the three types of version increments according to semantic versioning:
16+
- MAJOR: For incompatible API changes
17+
- MINOR: For backwards-compatible functionality additions
18+
- PATCH: For backwards-compatible bug fixes
19+
"""
20+
1321
MAJOR = auto()
1422
MINOR = auto()
1523
PATCH = auto()
@@ -80,6 +88,16 @@ def _find_highest_increment(
8088

8189

8290
class BumpRule(Protocol):
91+
"""A protocol defining the interface for version bump rules.
92+
93+
This protocol specifies the contract that all version bump rule implementations must follow.
94+
It defines how commit messages should be analyzed to determine the appropriate semantic
95+
version increment.
96+
97+
The protocol is used to ensure consistent behavior across different bump rule implementations,
98+
such as conventional commits or custom rules.
99+
"""
100+
83101
def get_increment(
84102
self, commit_message: str, major_version_zero: bool
85103
) -> SemVerIncrement | None:

0 commit comments

Comments
 (0)