GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tools: yaml lint command in vcbuild script by lutaok · Pull Request #48422 · nodejs/node

Conversation

@lutaok

@lutaok lutaok commented Jun 11, 2023 •
edited by marco-ippolito
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Hello everyone,
I'm opening this PR hoping it could be an enhancement for Windows contributors.

To give this a little context, when I was working on #48184 , I noticed that lint-yaml was run by a Github Action, but it was not present in the vcbuild.bat script that I used for building and linting files.

Following things were changed:

  • lint-yaml was added as a command in vcbuild script and it is executed through the Makefile corresponding command.
  • lint-yaml step was also added and enabled for execution on test and lint commands.
  • Made wsl make preferred for executing Makefile command on lint-cpp and lint-yaml because of Square brackets not being recognizable by Windows as a command.
  • Added lint-yaml reference to the help command.
  • Deleted an eslint text file in order to make lint-js command work again. lint-js execution would look at that file, throw a Syntax Error that onFatalError in eslint.js would catch and make the linter execution stop.
  • Disabled new-lines type checking from .yamllint.yaml in order to make linter work on Windows even though the execution was started on a Unix system (such as WSL). I think this could be re-enabled if we are able to use GNU Make instead of WSL to lint those files.

I also have two questions:

  • I noticed that lint command would skip the build process if it's already built, is this a behaviour that could be replicated for each lint-X command?
  • Regarding change no. 3, what's the best path to follow here? Makefile command accounting for Windows systems that can call it or just stick with WSL make and get rid of the GNU Make option?

Thanks for your attention!

@nodejs/build

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

marco-ippolito reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to Node.js builds or CI infrastructure. needs-ci PRs that need a full CI run. tools Issues and PRs related to the tools directory. windows Issues and PRs related to the Windows platform. labels Jun 11, 2023
@marco-ippolito marco-ippolito changed the title Add Yaml Lint command in vcbuild script tools: yaml Lint command in vcbuild script Jun 11, 2023
@marco-ippolito marco-ippolito changed the title tools: yaml Lint command in vcbuild script tools: yaml lint command in vcbuild script Jun 11, 2023
@lutaok
lutaok force-pushed the add-local-yaml-linter branch from e6bd7fb to c196999 Compare June 11, 2023 13:19
@Trott

Trott commented Jun 18, 2023

Copy link
Copy Markdown
Member
  • Deleted an eslint text file in order to make lint-js command work again. lint-js execution would look at that file, throw a Syntax Error that onFatalError in eslint.js would catch and make the linter execution stop.

I might be misunderstanding what's going on here, but I think that file will likely be re-added the next time eslint is updated. Regardless, lint-js should not be linting files that do not have a .*js suffix, so I'm not sure why it was causing a problem. (Like I said, I might just be not understanding what's going on here.)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lutaok

lutaok commented Jun 20, 2023

Copy link
Copy Markdown
Contributor Author
  • Deleted an eslint text file in order to make lint-js command work again. lint-js execution would look at that file, throw a Syntax Error that onFatalError in eslint.js would catch and make the linter execution stop.

I might be misunderstanding what's going on here, but I think that file will likely be re-added the next time eslint is updated. Regardless, lint-js should not be linting files that do not have a .*js suffix, so I'm not sure why it was causing a problem. (Like I said, I might just be not understanding what's going on here.)

Thank you for your response :)
I've investigated this problem more in depth and I found out that eslint text file wasn't the real problem. I'm sorry that I made the wrong assumptions.

I'll try to reconstruct my steps:

  • launch command lint-js from vcbuild.bat file -> Immediate Syntax Error on that eslint text file. In the error stack though there's a reference to tools\node_modules\eslint\node_modules\eslint-plugin-jsdoc\dist\rules\checkExamples.js:8:15 which is a require("eslint")
  • when that lines executes it always points back to the eslint text file, instead of actually pointing to tools\node_modules\eslint\lib\eslint\eslint.js
  • If I manually make the require go look for tools\node_modules\eslint\lib\eslint\eslint.js (with relative paths) then linting Javascript files works fine.

I wanted to bring this up before making any changes because I have no evidence this could work on other OSs where I suppose everything works great already.
Is require working differently between OSs? If so, do you think that replacing that require with relative paths could be a good solution?

Thank you again for your time and consideration!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Jun 23, 2023

Copy link
Copy Markdown
Member

This could use some more reviews. @nodejs/linting @nodejs/platform-windows

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@targos

targos commented Jun 24, 2023

Copy link
Copy Markdown
Member
  • Deleted an eslint text file in order to make lint-js command work again. lint-js execution would look at that file, throw a Syntax Error that onFatalError in eslint.js would catch and make the linter execution stop.

I might be misunderstanding what's going on here, but I think that file will likely be re-added the next time eslint is updated. Regardless, lint-js should not be linting files that do not have a .*js suffix, so I'm not sure why it was causing a problem. (Like I said, I might just be not understanding what's going on here.)

This file is a symbolic link. On Windows, symlinks are disabled by default and must be enabled manually.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lutaok
lutaok force-pushed the add-local-yaml-linter branch from c196999 to 6785e44 Compare July 29, 2023 13:41
@lutaok

lutaok commented Jul 29, 2023

Copy link
Copy Markdown
Contributor Author

Sorry for the late reply.
I've reverted the changes on the Eslint file. Enabling Symlinks by activating Developer Mode on Windows actually made lint-js command work.
Thanks for the suggestion!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Trott
Trott reviewed Jul 30, 2023
View reviewed changes
Comment thread .yamllint.yaml Resolved

Uh oh!

There was an error while loading. Please reload this page.

@lutaok
lutaok force-pushed the add-local-yaml-linter branch from 6785e44 to 493af9d Compare September 16, 2023 08:11
jasnell
jasnell approved these changes Sep 16, 2023
View reviewed changes
@lutaok
lutaok requested a review from Trott October 8, 2023 13:28
@aduh95

aduh95 commented May 11, 2024

Copy link
Copy Markdown
Contributor

This needs a rebase.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lutaok added 6 commits May 15, 2024 21:51
@lutaok
tools: add lint-yaml command to vcbuild script
873b340
Yaml linting was missing for windows users.
Reversed evaluation order for wsl and GNUMake of lint-yaml and lint-cpp.
Makefile not fully compatible with Windows, so WSL is now preferred.
Added "lint-yaml" command reference into "help" command.
Added "lint-yaml" step to "test" and "lint" commands.
@lutaok
tool: disable new-lines rule checking
6deae69
@lutaok
eslint: fix lint-js command execution on Windows
9d4de0b
vcbuild lint-js command would always fail on Windows.
eslint.js would inspect the deleted file and throw Syntax Error.
Since it didn't seem a meaningful file, it got deleted.
@lutaok
fix: revert eslint symlink file deletion
84fdad7
This reverts commit 4dbc523d0027b4918fa292438d7d0ce5dc387f93.
@lutaok
chore: set lf eol for yaml files
afb844f
Ref: nodejs#48422
@lutaok
chore: add yml extension
7ec56bb
@lutaok
lutaok force-pushed the add-local-yaml-linter branch from 47ff45e to 7ec56bb Compare May 15, 2024 19:56
@lutaok

lutaok commented May 15, 2024

Copy link
Copy Markdown
Contributor Author

This needs a rebase.

Done, thank you for the reminder! I've been away from my Windows setup for a bit.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

This pull request has been marked as stale due to 90 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the stale Issues and PRs marked stale due to inactivity and scheduled for automatic closure. label Jul 28, 2026
@avivkeller avivkeller closed this Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jasnell jasnell jasnell approved these changes
@Trott Trott Awaiting requested review from Trott

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

build Issues and PRs related to Node.js builds or CI infrastructure. needs-ci PRs that need a full CI run. stale Issues and PRs marked stale due to inactivity and scheduled for automatic closure. tools Issues and PRs related to the tools directory. windows Issues and PRs related to the Windows platform.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@lutaok @Trott @targos @aduh95 @jasnell @nodejs-github-bot @avivkeller
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.