Skip to content

Commit 6abbc53

Browse files
bearomorphismLee-W
authored andcommitted
refactor(bump): simplify nested if
1 parent 654f4a0 commit 6abbc53

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

commitizen/commands/bump.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -206,17 +206,13 @@ def __call__(self) -> None:
206206
if get_next:
207207
raise NotAllowed("--get-next cannot be combined with MANUAL_VERSION")
208208

209-
if self.bump_settings["major_version_zero"]:
210-
if not current_version.release[0] == 0:
211-
raise NotAllowed(
212-
f"--major-version-zero is meaningless for current version {current_version}"
213-
)
209+
if self.bump_settings["major_version_zero"] and current_version.release[0]:
210+
raise NotAllowed(
211+
f"--major-version-zero is meaningless for current version {current_version}"
212+
)
214213

215-
if build_metadata:
216-
if is_local_version:
217-
raise NotAllowed(
218-
"--local-version cannot be combined with --build-metadata"
219-
)
214+
if build_metadata and is_local_version:
215+
raise NotAllowed("--local-version cannot be combined with --build-metadata")
220216

221217
if get_next:
222218
# if trying to use --get-next, we should not allow --changelog or --changelog-to-stdout

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy