Skip to content

Commit 0d30fb5

Browse files
style(bump): Add mypy typing for _bump_with_regex
1 parent 3e19f16 commit 0d30fb5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

commitizen/bump.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from collections import OrderedDict
33
from itertools import zip_longest
44
from string import Template
5-
from typing import List, Optional, Union
5+
from typing import List, Optional, Tuple, Union
66

77
from packaging.version import Version
88

@@ -167,7 +167,9 @@ def update_version_in_files(
167167
file.write("".join(version_file))
168168

169169

170-
def _bump_with_regex(version_file_contents, current_version, new_version, regex):
170+
def _bump_with_regex(
171+
version_file_contents: str, current_version: str, new_version: str, regex: str
172+
) -> Tuple[bool, str]:
171173
current_version_found = False
172174
# Bumping versions that change the string length move the offset on the file contents as finditer keeps a
173175
# reference to the initial string that was used and calling search many times would lead in infinite loops

0 commit comments

Comments
 (0)