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

build,windows: clean lint paths in vcbuild.bat #12278

Closed
wants to merge 2 commits into from

Conversation

refack
Copy link
Contributor

@refack refack commented Apr 7, 2017

After #12276 I thought the lint code paths deserved some tweaking

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

build,windows

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. windows Issues and PRs related to the Windows platform. labels Apr 7, 2017
@refack
Copy link
Contributor Author

refack commented Apr 7, 2017

/cc @nodejs/platform-windows @liusy182

@refack refack self-assigned this Apr 7, 2017
@refack
Copy link
Contributor Author

refack commented Apr 7, 2017

@refack refack force-pushed the vcbuild_lint_pref branch 3 times, most recently from 6ef47e1 to 8e66a26 Compare April 7, 2017 23:38
* enable eslint to run even in a "clean" workspace
* small improvement in performance by reducing number of calls to `findstr`
* Document [jslint/jslint-ci] nodejs#11856 (comment)
vcbuild.bat Outdated
@@ -437,7 +445,7 @@ echo Failed to create vc project files.
goto exit

:help
echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-inspector/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/without-intl] [nobuild] [sign] [x86/x64] [vc2015] [download-all] [enable-vtune] [lint/lint-ci]
echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-inspector/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/without-intl] [nobuild] [sign] [x86/x64] [vc2015] [download-all] [enable-vtune] [lint/lint-ci/jslint/jslint-ci]
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason you're documenting jslint but not cpplint?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is no spoon cpplint arg, and the jslint arg was missed in #11856 (comment)

Copy link
Member

@gibfahn gibfahn Apr 8, 2017

Choose a reason for hiding this comment

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

Good point, I didn't notice that there isn't an option to just run cpplint (although there is a cpplint build target). Maybe there should be, there is in the Makefile and it makes sense to have them mirror each other if possible. Doesn't have to be done in this PR though!

:find_node
if exist %config%\node set nodeexe=%config%\node&exit /b
where node > nul 2> nul
if not errorlevel 1 set nodeexe=node&exit /b
Copy link
Member

@gibfahn gibfahn Apr 8, 2017

Choose a reason for hiding this comment

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

This picks up the Node in the path if there isn't a local one right? I guess that's alright for linting, as long as we're not doing it for testing as well.

Could you put a comment in to explain that? Something like:

@rem fall back to node.exe in path, used for linting only.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll rename the var to nodeexe4linting so noone will use it by accidant

set find_arg=%find_arg% /c:"src\\.*\\.*"
set find_arg=%find_arg% /c:"test\\addons\\[0-9].*_.*\.h"
set find_arg=%find_arg% /c:"test\\addons\\[0-9].*_.*\.cc"
echo %relpath% | findstr %find_arg% > nul
Copy link
Member

@gibfahn gibfahn Apr 8, 2017

Choose a reason for hiding this comment

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

Does this need a 2> nul as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope. findstr just prints matches, which is kinda useless information

if exist %config%\node set nodeexe=%config%\node&exit /b
where node > nul 2> nul
if not errorlevel 1 set nodeexe=node&exit /b
echo Could not file node.exe
Copy link
Member

Choose a reason for hiding this comment

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

Nit: file->find

@gibfahn
Copy link
Member

gibfahn commented Apr 8, 2017

I don't really know enough CMD scripting to properly review this, but it generally looks cleaner which is 👍 💯 .

Does the CI test linting on windows? I'd assume not. It did fail though, not sure if that's due to this PR.

@refack
Copy link
Contributor Author

refack commented Apr 8, 2017

Does the CI test linting on windows? I'd assume not. It did fail though, not sure if that's due to this PR.

It was like this before see #12276 (comment)

Copy link
Member

@gibfahn gibfahn left a comment

Choose a reason for hiding this comment

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

LGTM, although I wouldn't want to land this without people with actual Windows knowledge reviewing, especially as we can't really test this in CI AFAIK.

@refack
Copy link
Contributor Author

refack commented Apr 14, 2017

I'm closing this as the PR to complete #12310 will absorb this one.
@gibfahn thank for the review.

@refack refack closed this Apr 14, 2017
@refack refack removed their assignment Jun 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants