Conversation
Add a new option which will throw an error if any release sections have no changelog entries.
src/cli.ts
Outdated
| * Whether to validate that each release section has one or more changelog | ||
| * entries (true) or not (false). | ||
| */ | ||
| noEmptyReleases: boolean; |
There was a problem hiding this comment.
Nit: what do you think about renaming this to rejectEmptyReleases or ensureNonEmptyReleases to use similar tone of other options ?
There was a problem hiding this comment.
Good callout. This does seem a bit off. How does --disallowEmptyReleases sound?
There was a problem hiding this comment.
Yes sounds good to me!
There was a problem hiding this comment.
I ended up removing the option entirely: f20d3fc
src/cli.ts
Outdated
| type: 'boolean', | ||
| }) | ||
| .option('noEmptyReleases', { | ||
| default: false, |
There was a problem hiding this comment.
Is there a reason to not enable this functionality by default?
There was a problem hiding this comment.
We could, but it would be a breaking change, since any changelogs that already have empty release sections would fail validation now. So I was a bit hesitant to make that change now. That said, I suspect that most projects' changelogs are compliant and would require no work to upgrade. What do you think?
There was a problem hiding this comment.
IMO worth it to make the breaking change and deal with the limited invalid changelogs that will come up.
There was a problem hiding this comment.
Okay, I've made this behavior the default here: f20d3fc
Currently, a release section is valid if it is empty, i.e., has no changelog entries. This commit reverses that behavior.
Note
Medium Risk
Behavioral change to
validateChangelogthat can newly fail existing changelogs/CI if they contain header-only releases; otherwise limited to validation logic.Overview
validateChangelognow enforces that every release section contains at least one changelog entry, throwing a newEmptyReleaseErrorwhen a release has zero categorized items.Tests are updated to expect this failure for empty releases (both RC and non-RC scenarios), and the
CHANGELOG.mdnotes this as a breaking change.Written by Cursor Bugbot for commit f20d3fc. This will update automatically on new commits. Configure here.