Skip to content

Commit 7735755

Browse files
bearomorphismLee-W
authored andcommitted
refactor(bump): use any to replace 'or' chain
1 parent 150b35d commit 7735755

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

commitizen/commands/bump.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ def __call__(self) -> None:
231231
else:
232232
# If user specified changelog_to_stdout, they probably want the
233233
# changelog to be generated as well, this is the most intuitive solution
234-
self.changelog_flag = bool(
235-
self.changelog_flag or self.changelog_to_stdout or self.changelog_config
234+
self.changelog_flag = any(
235+
(self.changelog_flag, self.changelog_to_stdout, self.changelog_config)
236236
)
237237

238238
rules = TagRules.from_settings(cast(Settings, self.bump_settings))
@@ -410,14 +410,18 @@ def __call__(self) -> None:
410410

411411
c = git.tag(
412412
new_tag_version,
413-
signed=bool(
414-
self.bump_settings.get("gpg_sign")
415-
or self.config.settings.get("gpg_sign")
413+
signed=any(
414+
(
415+
self.bump_settings.get("gpg_sign"),
416+
self.config.settings.get("gpg_sign"),
417+
)
416418
),
417-
annotated=bool(
418-
self.bump_settings.get("annotated_tag")
419-
or self.config.settings.get("annotated_tag")
420-
or self.bump_settings.get("annotated_tag_message")
419+
annotated=any(
420+
(
421+
self.bump_settings.get("annotated_tag"),
422+
self.config.settings.get("annotated_tag"),
423+
self.bump_settings.get("annotated_tag_message"),
424+
)
421425
),
422426
msg=self.bump_settings.get("annotated_tag_message", None),
423427
# TODO: also get from self.config.settings?

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