Skip to content
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

feat: allowlist for version numbers in YAML comments #172

Merged
merged 4 commits into from Feb 22, 2021

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Feb 4, 2021

If an environment variable NODE_RELEASED_VERSIONS is detected, it is
used to validate the version numbers in the YAML comments. At the
notable exception of version numbers 0.0.x and 0.1.x, and the
REPLACEME placeholder, any value not in the list is reported as
invalid.

The idea is to add a script on the node repo GH actions to parse the changelogs to populate the env variable. It won't change anything for doing local linting, but may help spot version errors when reviewing PRs.
For info, it let me spot nodejs/node#37231 and nodejs/node#37232, and I've seen a few times contributors trying to guess the next release version number because they didn't know about REPLACEME.

If an environment variable `NODE_RELEASED_VERSIONS` is detected, it is
used to validate the version numbers in the YAML comments. At the
notable exception of version numbers 0.0.x and 0.1.x,  and the
`REPLACEME` placeholder, any value not in the list is reported as
invalid.
@Trott
Copy link
Member

Trott commented Feb 8, 2021

Might be worth documenting this feature in the README or elsewhere?

@aduh95
Copy link
Contributor Author

aduh95 commented Feb 22, 2021

I think this is ready to land. Thoughts?

@Trott Trott merged commit b74556c into nodejs:master Feb 22, 2021
@aduh95 aduh95 deleted the lint-version-number-changelog branch February 22, 2021 13:28
aduh95 added a commit to aduh95/node that referenced this pull request Mar 6, 2021
PR-URL: nodejs#37599
Refs: nodejs/remark-preset-lint-node#172
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
danielleadams pushed a commit to nodejs/node that referenced this pull request Mar 16, 2021
PR-URL: #37599
Refs: nodejs/remark-preset-lint-node#172
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit to nodejs/node that referenced this pull request May 1, 2021
PR-URL: #37599
Refs: nodejs/remark-preset-lint-node#172
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants