-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix changelog where first release isn't first #76
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just one nit.
src/changelog.ts
Outdated
@@ -139,20 +139,21 @@ function stringifyLinkReferenceDefinitions( | |||
// patch releases on older releases can be accomodated. | |||
const releaseLinkReferenceDefinitions = releases | |||
.map(({ version }) => { | |||
let diffUrl; | |||
if (version === orderedReleases[orderedReleases.length - 1]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only feedback is that orderedReleases
(and really the releases param) could be documented / named such that it's immediately obvious that the releases are sorted in chronological order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, I'll rename this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 027e394
`auto-changelog` will now correctly update and validate changelogs where the first release chronologically is different than the first release numerically. A test has been added to ensure such a changelog is now validated correctly. This test fails on `main`. Fixes #57
69d433e
to
027e394
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sold.
auto-changelog
will now correctly update and validate changelogs where the first release chronologically is different than the first release numerically.A test has been added to ensure such a changelog is now validated correctly. This test fails on
main
.Fixes #57