Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8689546

Browse files
jaysonsantosLee-W
authored andcommitted
chore: Fix CR questions
1 parent cd7018e commit 8689546

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
@@ -154,7 +154,9 @@ def update_version_in_files(
154154
regex = regexes[0] if regexes else None
155155
current_version_found = False
156156

157-
version_file = open(filepath, "r").read()
157+
with open(filepath, "r") as f:
158+
version_file = f.read()
159+
158160
match = regex and re.search(regex, version_file, re.MULTILINE)
159161
if match:
160162
left = version_file[: match.end()]
@@ -167,7 +169,7 @@ def update_version_in_files(
167169

168170
if not regex:
169171
current_version_regex = _version_to_regex(current_version)
170-
current_version_found = current_version_regex.search(version_file)andTrue
172+
current_version_found = bool(current_version_regex.search(version_file))
171173
version_file = current_version_regex.sub(new_version, version_file)
172174

173175
if check_consistency and not current_version_found:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /