fix(commands/bump): prevent using incremental changelog when it is set to false in config#996
Conversation
661a140 to
d4894e5
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #996 +/- ##
=======================================
Coverage 97.99% 97.99%
=======================================
Files 60 60
Lines 2691 2692 +1
=======================================
+ Hits 2637 2638 +1
Misses 54 54 ☔ View full report in Codecov by Sentry. |
d4894e5 to
45b9352
Compare
|
Just opening the debate: wouldn't it be easier and more consistent to fix/align the default By adding a fourth settings source of trust (defaults, user settings, cli flags and now mutated settings, fifth if you add the fact that plugins can override some settings), I feel that we are fixing a symptom but making the problem more complex. |
Yeah, I think that would be a better way to address the issue if possible. The implementation would be easier and also could prevent overriding the behaviors from multiple sources when running the |
Could you make a proposal for this? It sounds interesting, would be nice if we can simplify the settings |
|
I'm a bit confused here. I thought we could solve it by reading the value from config? |
I think there are total three combinations of configurations here:
The 1st & 3rd cases would cause ambiguity when we're reading the value from |
I thought the one from the config should overwrite the default. Or did I miss anything? |
|
Hello, Do you guys have any news on this fix ? |
|
@josix what is the status of this PR? Thanks! |
|
Oh I missed this comment, let me pick this up |
|
Thanks! |
d439c38 to
aef2004
Compare
c2df766 to
5ecaa15
Compare
5ecaa15 to
7162151
Compare
7162151 to
9c8f89a
Compare
| "incremental": incremental_setting | ||
| if incremental_setting is not None | ||
| else True, |
There was a problem hiding this comment.
This probably also works and is less confusing
| "incremental": incremental_setting | |
| if incremental_setting is not None | |
| else True, | |
| "incremental": self.config.settings.get("changelog_incremental", True), |
Fix #883
Description
Since the default behavior of
cz bump --changelogis to write incremental changelog, which is different from the default value ofchangelog_incremental, it is hard to know the value is set from user or the default setting, To address it, I created one more member inBaseConfigto record which property is defined from users so that we could distinguish the value is from default setting or users.Checklist
./scripts/formatand./scripts/testlocally to ensure this change passes linter check and testExpected behavior
cz bump --changelogshould work asfalsewhen user configurechangelog_incrementaltofalse.Steps to Test This Pull Request
Modify the CHANGELOG file

Configure
pyproject.tomlwithchangelog_incremental = falseRun
cz bump --changelogCheck the CHANGELOG, which the new added content should be replaced

Additional context
ditto.