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

Since nvm v0.40.0 .nvmrc may contain comments #1119

Open
sdavids opened this issue Aug 4, 2024 · 5 comments
Open

Since nvm v0.40.0 .nvmrc may contain comments #1119

sdavids opened this issue Aug 4, 2024 · 5 comments
Labels
feature request New feature or request to improve the current logic

Comments

@sdavids
Copy link

sdavids commented Aug 4, 2024

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 sdavids added bug Something isn't working needs triage labels Aug 4, 2024
@aparnajyothi-y
Copy link
Contributor

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

@priyagupta108 priyagupta108 self-assigned this Aug 6, 2024
@priyagupta108
Copy link
Contributor

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.

@sdavids
Copy link
Author

sdavids commented Aug 9, 2024

Just having a test for:

.nvmrc

# comment
20.16.0

would be enough.

@sdavids
Copy link
Author

sdavids commented Aug 9, 2024

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

@priyagupta108
Copy link
Contributor

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 priyagupta108 added feature request New feature or request to improve the current logic and removed bug Something isn't working labels Aug 28, 2024
@priyagupta108 priyagupta108 removed their assignment Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request to improve the current logic
Projects
None yet
Development

No branches or pull requests

3 participants