Skip to content

Commit dd85165

Browse files
committed
docs(BaseCommitizen): doc bump_rule
1 parent c45c96f commit dd85165

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

commitizen/cz/base.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,24 @@ def style(self):
9393

9494
@cached_property
9595
def bump_rule(self) -> BumpRule:
96+
"""Get the bump rule for version incrementing.
97+
98+
This property returns a BumpRule instance that determines how version numbers
99+
should be incremented based on commit messages. It first checks if a custom
100+
bump rule was set via `_bump_rule`. If not, it falls back to creating a
101+
CustomBumpRule using the class's bump pattern and maps.
102+
103+
The CustomBumpRule requires three components to be defined:
104+
- bump_pattern: A regex pattern to match commit messages
105+
- bump_map: A mapping of commit types to version increments
106+
- bump_map_major_version_zero: A mapping for version increments when major version is 0
107+
108+
Returns:
109+
BumpRule: A rule instance that determines version increments
110+
111+
Raises:
112+
NoPatternMapError: If the required bump pattern or maps are not defined
113+
"""
96114
if self._bump_rule:
97115
return self._bump_rule
98116

0 commit comments

Comments
 (0)