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 134f5de

Browse files
bearomorphismLee-W
authored andcommitted
refactor(bump): use any to replace 'or' chain
1 parent 27ee98b commit 134f5de

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_flagorself.changelog_to_stdoutorself.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)

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