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
  • Loading branch information
josix committed Feb 29, 2024
1 parent fc54b51 commit 661a140
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 type(self) is not BaseConfig

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

0 comments on commit 661a140

Please sign in to comment.