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: Add node language version #2628

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

hofbi
Copy link

@hofbi hofbi commented Dec 5, 2024

Closes #2460

This avoids that pre-commit picks the latest node version available that might not be supported by renovate. Users can still override this if they want.

@jonesbusy
Copy link

What about

language_version: lts

It will ensure to stay on LTS instead of unsupported active version

@hofbi
Copy link
Author

hofbi commented Dec 5, 2024

@jonesbusy did not know that this feature existed. Do you know that this works? Do you have any example/documentation where this is mentioned?

Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs updated renovate config as mentioned in issue.

is this a fixed version or can we use a range? will that version automatically downloaded?

@jonesbusy
Copy link

https://pre-commit.com/#overriding-language-version

The language_version is passed directly to the underlying tool. In that case nodeenv

I've just tested

nodeenv --node=lts .test
 * Install prebuilt node (22.12.0) ..... done.

.pre-commit-hooks.yaml Outdated Show resolved Hide resolved
@hofbi
Copy link
Author

hofbi commented Dec 5, 2024

Changed to lts.

@viceice what would have to be changed in the renovate config?

@viceice
Copy link
Member

viceice commented Dec 9, 2024

does it support setting the major version only? because renovate sometimes doesn't support the newest lts for some time.

@viceice viceice changed the title Add a default for the node language version feat: Add node language version Dec 9, 2024
@jonesbusy
Copy link

Apparently not

I tried without success

nodeenv --node=22.x .test
nodeenv --node=22 .test

@hofbi
Copy link
Author

hofbi commented Dec 10, 2024

Being said that you don't always support the latest LTS version, we might want to explicitly specify the node version to be used. This way, you can explicitly define what should be used and is supported.

If this becomes to much manual effort, maybe renovate can autoupdate this as well. WDYT @viceice.

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.

Crash when installing: enoent ENOENT: no such file or directory
3 participants