Skip to content

refactor: improve types and avoid nested loop, add types for untyped functions #1466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Jun 8, 2025
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f4b81b7
style(tags): improve types
bearomorphism May 29, 2025
8b4a5fd
perf(tags): use set
bearomorphism May 29, 2025
51fdc4f
refactor: fix mypy output and better type
bearomorphism May 29, 2025
2ec92cc
refactor(conventional_commits): remove unnecessary checks
bearomorphism May 29, 2025
7ca5f79
refactor: make methods protected, better type
bearomorphism May 30, 2025
7179dd3
style: remove unnecessary noqa
bearomorphism May 30, 2025
9b13386
style: type untyped methods
bearomorphism May 30, 2025
b999189
style: remove Union
bearomorphism May 30, 2025
ea22ca4
style: better type
bearomorphism May 30, 2025
ce05562
style: add `-> None` to __init__
bearomorphism May 30, 2025
28ac03b
build(ruff,mypy): more strict rules
bearomorphism May 30, 2025
95c50e3
fix(BaseConfig): mypy error
bearomorphism May 31, 2025
32836b2
build(mypy): remove disallow_untyped_defs because it's already done b…
bearomorphism May 31, 2025
f0bdd55
refactor(bump): TypedDict for bump argument
bearomorphism May 30, 2025
32d7adb
refactor(changelog): type untyped arguments
bearomorphism May 31, 2025
a4b9ae9
refactor(check): remove unused argument
bearomorphism May 31, 2025
0493765
style(bump): rename class for consistency
bearomorphism May 31, 2025
e67ba23
refactor(check): type CheckArgs arguments
bearomorphism May 31, 2025
1f8c4bc
refactor(commit): type commit args
bearomorphism May 31, 2025
f771da3
refactor(commands): remove unused args, type version command args
bearomorphism May 31, 2025
d72e7ec
style(cli): shorten arg type
bearomorphism May 31, 2025
8562209
docs(bump): comment on a stupid looking pattern
bearomorphism May 31, 2025
9b99924
fix(Check): make parameters backward compatiable
bearomorphism May 31, 2025
92a92bc
style(changelog): rename parameter for consistency
bearomorphism May 31, 2025
95a9140
refactor(bump): improve readability and still bypass mypy check
bearomorphism May 31, 2025
19efaa8
refactor: remove unnecessary bool() and remove Any type from TypedDic…
bearomorphism May 31, 2025
38fe5bf
style(changelog): add TODO to fixable type ignores
bearomorphism Jun 4, 2025
24c8201
style(cli): more specific type ignore
bearomorphism Jun 4, 2025
ac9e742
style(cli): rename kwarg to values
bearomorphism Jun 4, 2025
667efef
refactor(bump): use any to replace 'or' chain
bearomorphism Jun 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor(bump): improve readability and still bypass mypy check
  • Loading branch information
bearomorphism committed May 31, 2025
commit 95a9140e2d5f290cf6773fad8b88d77e981c513d
31 changes: 15 additions & 16 deletions commitizen/commands/bump.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,21 @@ def __init__(self, config: BaseConfig, arguments: BumpArgs) -> None:
**config.settings,
**{
k: v
for k, v in {
# All these are for making mypy happy
"annotated_tag_message": arguments.get("annotated_tag_message"),
"annotated_tag": arguments.get("annotated_tag"),
"bump_message": arguments.get("bump_message"),
"file_name": arguments.get("file_name"),
"gpg_sign": arguments.get("gpg_sign"),
"increment_mode": arguments.get("increment_mode"),
"increment": arguments.get("increment"),
"major_version_zero": arguments.get("major_version_zero"),
"prerelease_offset": arguments.get("prerelease_offset"),
"prerelease": arguments.get("prerelease"),
"tag_format": arguments.get("tag_format"),
"template": arguments.get("template"),
}.items()
if v is not None
for k in (
"annotated_tag_message",
"annotated_tag",
"bump_message",
"file_name",
"gpg_sign",
"increment_mode",
"increment",
"major_version_zero",
"prerelease_offset",
"prerelease",
"tag_format",
"template",
)
if (v := arguments.get(k)) is not None
},
},
)
Expand Down