Skip to content

Commit 19efaa8

Browse files
committed
refactor: remove unnecessary bool() and remove Any type from TypedDict get
1 parent 95a9140 commit 19efaa8

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

commitizen/commands/bump.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
class BumpArgs(Settings, total=False):
4141
allow_no_commit: bool | None
4242
annotated_tag_message: str | None
43-
annotated_tag: bool
4443
build_metadata: str | None
4544
changelog_to_stdout: bool
4645
changelog: bool
@@ -51,7 +50,6 @@ class BumpArgs(Settings, total=False):
5150
files_only: bool | None
5251
get_next: bool
5352
git_output_to_stderr: bool
54-
gpg_sign: bool
5553
increment_mode: str
5654
increment: Increment | None
5755
local_version: bool
@@ -222,7 +220,7 @@ def __call__(self) -> None:
222220

223221
if get_next:
224222
# if trying to use --get-next, we should not allow --changelog or --changelog-to-stdout
225-
if self.changelog_flag or bool(self.changelog_to_stdout):
223+
if self.changelog_flag or self.changelog_to_stdout:
226224
raise NotAllowed(
227225
"--changelog or --changelog-to-stdout is not allowed with --get-next"
228226
)
@@ -234,9 +232,7 @@ def __call__(self) -> None:
234232
# If user specified changelog_to_stdout, they probably want the
235233
# changelog to be generated as well, this is the most intuitive solution
236234
self.changelog_flag = bool(
237-
self.changelog_flag
238-
or bool(self.changelog_to_stdout)
239-
or self.changelog_config
235+
self.changelog_flag or self.changelog_to_stdout or self.changelog_config
240236
)
241237

242238
rules = TagRules.from_settings(cast(Settings, self.bump_settings))

commitizen/defaults.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,18 @@ class Settings(TypedDict, total=False):
3232
allow_abort: bool
3333
allowed_prefixes: list[str]
3434
always_signoff: bool
35+
annotated_tag: bool
3536
bump_message: str | None
37+
change_type_map: dict[str, str]
3638
changelog_file: str
3739
changelog_format: str | None
3840
changelog_incremental: bool
3941
changelog_merge_prerelease: bool
40-
change_type_map: dict[str, str]
4142
changelog_start_rev: str | None
4243
customize: CzSettings
4344
encoding: str
4445
extras: dict[str, Any]
46+
gpg_sign: bool
4547
ignored_tag_formats: Sequence[str]
4648
legacy_tag_formats: Sequence[str]
4749
major_version_zero: bool

0 commit comments

Comments
 (0)