MCPcopy Index your code
hub / github.com/commitizen-tools/commitizen / _find_increment

Method _find_increment

commitizen/commands/bump.py:147–161  ·  view source on GitHub ↗
(self, commits: list[git.GitCommit])

Source from the content-addressed store, hash-verified

145 return bool(questionary.confirm("Is this the first tag created?").ask())
146
147 def _find_increment(self, commits: list[git.GitCommit]) -> Increment | None:
148 # Update the bump map to ensure major version doesn't increment.
149 # self.cz.bump_map = defaults.bump_map_major_version_zero
150 bump_map = (
151 self.cz.bump_map_major_version_zero
152 if self.bump_settings["major_version_zero"]
153 else self.cz.bump_map
154 )
155 bump_pattern = self.cz.bump_pattern
156
157 if not bump_map or not bump_pattern:
158 raise NoPatternMapError(
159 f"'{self.config.settings['name']}' rule does not support bump"
160 )
161 return bump.find_increment(commits, regex=bump_pattern, increments_map=bump_map)
162
163 def _validate_arguments(self, current_version: VersionProtocol) -> None:
164 errors: list[str] = []

Callers 1

Calls 1

NoPatternMapErrorClass · 0.90

Tested by

no test coverage detected