Skip to content

Commit c1b1386

Browse files
chadrikwoile
authored andcommitted
fix(bump): remove unused method
1 parent 6b84f30 commit c1b1386

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

commitizen/commands/bump.py

-31
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
from commitizen.version_schemes import (
2828
get_version_scheme,
2929
InvalidVersion,
30-
VersionProtocol,
3130
)
3231

3332
logger = getLogger("commitizen")
@@ -397,33 +396,3 @@ def _get_commit_args(self):
397396
if self.no_verify:
398397
commit_args.append("--no-verify")
399398
return " ".join(commit_args)
400-
401-
def find_previous_final_version(
402-
self, current_version: VersionProtocol
403-
) -> VersionProtocol | None:
404-
tag_format: str = self.bump_settings["tag_format"]
405-
current = bump.normalize_tag(
406-
current_version,
407-
tag_format=tag_format,
408-
scheme=self.scheme,
409-
)
410-
411-
final_versions = []
412-
for tag in git.get_tag_names():
413-
assert tag
414-
try:
415-
version = self.scheme(tag)
416-
if not version.is_prerelease or tag == current:
417-
final_versions.append(version)
418-
except InvalidVersion:
419-
continue
420-
421-
if not final_versions:
422-
return None
423-
424-
final_versions = sorted(final_versions)
425-
current_index = final_versions.index(current_version)
426-
previous_index = current_index - 1
427-
if previous_index < 0:
428-
return None
429-
return final_versions[previous_index]

0 commit comments

Comments
 (0)