Skip to content

Commit 60c1d6b

Browse files
committed
no-mistakes(ci): Removed the unintended commitizen.bump.find_increment compatibility shim from commitizen/bump.py and deleted the shim-only regression test file tests/test_bump_find_increment.py, preserving the approved docs/example follow-up changes. Verified with uv run pytest tests/commands/test_documented_python_class_examples.py tests/test_version_increment.py and uv run ruff check commitizen/bump.py tests/commands/test_documented_python_class_examples.py tests/test_version_increment.py docs/examples/cz_docs_only.py
1 parent 7500091 commit 60c1d6b

2 files changed

Lines changed: 3 additions & 60 deletions

File tree

‎commitizen/bump.py‎

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,16 @@
44
import re
55
from glob import iglob
66
from string import Template
7-
from typing import TYPE_CHECKING, cast
7+
from typing import TYPE_CHECKING
88

99
from commitizen.defaults import BUMP_MESSAGE
1010
from commitizen.exceptions import CurrentVersionNotFoundError
1111
from commitizen.git import smart_open
12-
from commitizen.version_increment import VersionIncrement
1312

1413
if TYPE_CHECKING:
15-
from collections.abc import Generator, Iterable, Mapping
14+
from collections.abc import Generator, Iterable
1615

17-
from commitizen.git import GitCommit
18-
from commitizen.version_schemes import Increment, VersionProtocol
19-
20-
21-
def find_increment(
22-
commits: list[GitCommit], regex: str, increments_map: Mapping[str, object]
23-
) -> Increment | None:
24-
"""Preserve the legacy bump helper as a compatibility shim.
25-
26-
This public helper remains available for integrations importing
27-
``commitizen.bump.find_increment`` while delegating the real increment
28-
comparison and extraction logic to ``VersionIncrement``.
29-
"""
30-
increment = VersionIncrement.get_highest_by_messages(
31-
(commit.message for commit in commits),
32-
regex,
33-
increments_map,
34-
)
35-
if increment == VersionIncrement.NONE:
36-
return None
37-
return cast("Increment", str(increment))
16+
from commitizen.version_schemes import VersionProtocol
3817

3918

4019
def update_version_in_files(

‎tests/test_bump_find_increment.py‎

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)