GeezerVison is showing github.com — tools: yaml lint command in vcbuild script by lutaok · Pull Request #48422 · nodejs/node
Conversation
lutaok
commented
Jun 11, 2023
•
edited by marco-ippolito
Loading
Uh oh!
There was an error while loading. Please reload this page.
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
marco-ippolito
changed the title
tools: yaml Lint command in vcbuild script
tools: yaml lint command in vcbuild script
Jun 11, 2023
- 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.)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
- 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!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
This could use some more reviews. @nodejs/linting @nodejs/platform-windows
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
- 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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
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.
This reverts commit 4dbc523d0027b4918fa292438d7d0ce5dc387f93.
This needs a rebase.
Done, thank you for the reminder! I've been away from my Windows setup for a bit.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
jasnell
jasnell approved these changes
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.
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.
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.
|