setup-node icon indicating copy to clipboard operation
setup-node copied to clipboard

Since nvm v0.40.0 .nvmrc may contain comments

Open sdavids opened this issue 1 year ago • 6 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.

sdavids avatar Aug 04 '24 11:08 sdavids

Hello @sdavids, Thank you for creating this issue and we will look into it :)

aparnajyothi-y avatar Aug 05 '24 14:08 aparnajyothi-y

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.

priyagupta108 avatar Aug 09 '24 04:08 priyagupta108

Just having a test for:

.nvmrc

# comment
20.16.0

would be enough.

sdavids avatar Aug 09 '24 04:08 sdavids

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).

sdavids avatar Aug 09 '24 04:08 sdavids

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.

priyagupta108 avatar Aug 20 '24 06:08 priyagupta108