Since nvm v0.40.0 .nvmrc may contain comments
Description:
Since nvm v0.40.0 .nvmrc may contain comments.
[New] allow .nvmrc files to support comments
Action version: v4.0.3
Repro steps:
- uses: actions/[email protected]
with:
node-version-file: .nvmrc
.nvmrc
# comment
20.16.0
Expected behavior:
.nvmrc files with comments are supported.
Actual behavior: I have not verified it yet.
If it works already than this issue should at least add another test to the test suite.
Hello @sdavids, Thank you for creating this issue and we will look into it :)
Hi @sdavids,
I have tested and verified that .nvmrc files with comments are supported.
Could you please provide more details about the specific test you believe should be added to the test suite? Understanding your requirements in detail will help us address your concerns more effectively.
Just having a test for:
.nvmrc
# comment
20.16.0
would be enough.
The contents of a .nvmrc file must contain precisely one
(as described by nvm --help) followed by a newline. .nvmrc files may also have comments. The comment delimiter is #, and it and any text after it, as well as blank lines, and leading and trailing white space, will be ignored when parsing. Key/value pairs using = are also allowed and ignored, but are reserved for future use, and may cause validation errors in the future.
https://github.com/nvm-sh/nvm/blob/master/README.md#nvmrc
I do not think all comment locations need to be tested for setup-node, nor should the key-value syntax be tested (yet).
Hi @sdavids,
Thank you for your valuable suggestion. After analyzing the issue, it seems to be more of an enhancement rather than a bug. I have tested and verified that .nvmrc files with basic comments are supported.
The idea of incorporating extended comment support in .nvmrc files could significantly enhance the usability of setup-node. Your suggestion has been taken into consideration, and we will explore the possibility of incorporating it in future updates.
Please feel free to share any further insights or suggestions you may have.