Commit 3449f6d
fix(changelog): allow --no-incremental to override changelog_incremental config
The "Bump version" workflow's release-notes step runs
`cz changelog --dry-run "${NEW_VERSION}"`, passing the new version as a
positional rev_range. Since pyproject.toml sets `changelog_incremental = true`
(#2074), this combination now always raises
"--incremental cannot be combined with a rev_range", failing every release.
There was previously no way to override a config-enabled
`changelog_incremental` back to false from the CLI, since `--incremental` was
a plain store_true flag defaulting to False.
- Change `--incremental` to use argparse.BooleanOptionalAction (default None),
adding a `--no-incremental` flag.
- CLI flag now takes precedence over the `changelog_incremental` config
setting; falls back to config only when neither flag is passed.
Note: `.github/workflows/bumpversion.yml` still needs to be updated to pass
`--no-incremental` in its release-notes step, but that change requires the
`workflow` OAuth scope and is left for a follow-up/maintainer to apply.
`cz bump`'s internal changelog call already hardcodes incremental=True, so it
is unaffected by this change.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 4967717 commit 3449f6d
2 files changed
Lines changed: 16 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
416 | | - | |
417 | | - | |
| 416 | + | |
| 417 | + | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
421 | 423 | | |
422 | 424 | | |
423 | 425 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
83 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
84 | 91 | | |
85 | 92 | | |
86 | 93 | | |
| |||
0 commit comments