Repository navigation
Match changelog headings against whole lines only - #5
Merged
Merged
Conversation
The bump was decided by grepping the [Unreleased] text for the bare substring `### Changed`, so an entry that merely mentioned the heading — “`### Changed` now bumps the minor version” — counted as one. That is how 6.0.0 came to be: an Added/Fixed release turned major by its own release notes. `grep -x` anchors the match to a whole line, which is what a heading is. A heading with trailing text no longer matches either, and falls through to the “unexpected format” error as any other unknown heading.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What went wrong
6.0.0shipped with no breaking changes in it. The[Unreleased]section had only### Addedand### Fixed, but one of theAddedentries said “Below1.0.0,### Changednow bumps the minor version…” — and the heading detector greps the whole section text for the substring### Changed, so the mention counted as the heading.Fix
The three headings are matched against whole lines (
grep -x), which is what a heading is. A heading with trailing text (### Changed things) no longer matches either and falls through to the existing “does not follow the expected format” error, like any other unknown heading.Also
tests/version-detection.test.sh; the suite is at 98 passing.CHANGELOG.mdentry under### Fixed— the next release is6.0.1.6.0.0stays as it is: it is already on npm and it is harmless, only one major too many.