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 95a9140

Browse files
refactor(bump): improve readability and still bypass mypy check
1 parent 92a92bc commit 95a9140

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

‎commitizen/commands/bump.py‎

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,22 +78,21 @@ def __init__(self, config: BaseConfig, arguments: BumpArgs) -> None:
7878
**config.settings,
7979
**{
8080
k: v
81-
for k, v in {
82-
# All these are for making mypy happy
83-
"annotated_tag_message": arguments.get("annotated_tag_message"),
84-
"annotated_tag": arguments.get("annotated_tag"),
85-
"bump_message": arguments.get("bump_message"),
86-
"file_name": arguments.get("file_name"),
87-
"gpg_sign": arguments.get("gpg_sign"),
88-
"increment_mode": arguments.get("increment_mode"),
89-
"increment": arguments.get("increment"),
90-
"major_version_zero": arguments.get("major_version_zero"),
91-
"prerelease_offset": arguments.get("prerelease_offset"),
92-
"prerelease": arguments.get("prerelease"),
93-
"tag_format": arguments.get("tag_format"),
94-
"template": arguments.get("template"),
95-
}.items()
96-
if v is not None
81+
for k in (
82+
"annotated_tag_message",
83+
"annotated_tag",
84+
"bump_message",
85+
"file_name",
86+
"gpg_sign",
87+
"increment_mode",
88+
"increment",
89+
"major_version_zero",
90+
"prerelease_offset",
91+
"prerelease",
92+
"tag_format",
93+
"template",
94+
)
95+
if (v := arguments.get(k)) is not None
9796
},
9897
},
9998
)

0 commit comments

Comments
(0)

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