Skip to content

Commit

Permalink
fix(commands/bump): prevent using incremental changelog when it is se…
Browse files Browse the repository at this point in the history
…t to false in config

commitizen-tools#883
  • Loading branch information
wilsonwang-appier committed Feb 29, 2024
1 parent fc54b51 commit cf6e6cb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
15 changes: 13 additions & 2 deletions commitizen/commands/bump.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,11 @@ def __call__(self) -> None: # noqa: C901
"unreleased_version": new_tag_version,
"template": self.template,
"extras": self.extras,
"incremental": True,
"incremental": (
True
if not self.config.is_customized
else self.config.settings.get("changelog_incremental")
),
"dry_run": True,
},
)
Expand All @@ -305,7 +309,14 @@ def __call__(self) -> None: # noqa: C901
self.config,
{
"unreleased_version": new_tag_version,
"incremental": True,
"incremental": self.config.settings.get(
"changelog_incremental",
(
True
if not self.config.is_customized
else self.config.settings.get("changelog_incremental")
),
),
"dry_run": dry_run,
"template": self.template,
"extras": self.extras,
Expand Down
4 changes: 4 additions & 0 deletions commitizen/config/base_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ def settings(self) -> Settings:
def path(self) -> Path | None:
return self._path

@property
def is_customized(self) -> bool:
return self.__class__ != BaseConfig

def set_key(self, key, value):
"""Set or update a key in the conf.
Expand Down

0 comments on commit cf6e6cb

Please sign in to comment.