Skip to content

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

Closed
refack wants to merge 2 commits into
nodejs:masterfrom
refack:vcbuild_lint_pref
Closed

build,windows: clean lint paths in vcbuild.bat#12278
refack wants to merge 2 commits into
nodejs:masterfrom
refack:vcbuild_lint_pref

Conversation

@refack

@refackrefack commented Apr 7, 2017

Copy link
Copy Markdown
Contributor

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-botnodejs-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
Copy Markdown
ContributorAuthor

/cc @nodejs/platform-windows @liusy182

@refackrefack self-assigned this Apr 7, 2017
@refack

Copy link
Copy Markdown
ContributorAuthor

@refackrefack mentioned this pull request Apr 7, 2017
4 tasks
@refack
refackforce-pushed the vcbuild_lint_pref branch 3 times, most recently from 6ef47e1 to 8e66a26CompareApril 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)
@refack
refackforce-pushed the vcbuild_lint_pref branch from 8e66a26 to 4aab082CompareApril 8, 2017 00:03
Comment threadvcbuild.bat Outdated

: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
Copy Markdown
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
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

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

@gibfahngibfahnApr 8, 2017

Copy link
Copy Markdown
Member

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!

Comment threadvcbuild.bat
: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

@gibfahngibfahnApr 8, 2017

Copy link
Copy Markdown
Member

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
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

👍

Copy link
Copy Markdown
ContributorAuthor

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

Comment threadvcbuild.bat
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

@gibfahngibfahnApr 8, 2017

Copy link
Copy Markdown
Member

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
Copy Markdown
ContributorAuthor

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

Comment threadvcbuild.bat
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
Copy Markdown
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

gibfahn commented Apr 8, 2017

Copy link
Copy Markdown
Member

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
Copy Markdown
ContributorAuthor

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)

@refack
refackforce-pushed the vcbuild_lint_pref branch from 4aab082 to 37bbe38CompareApril 8, 2017 12:41

@gibfahngibfahn left a comment

Copy link
Copy Markdown
Member

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
refackforce-pushed the vcbuild_lint_pref branch from 37bbe38 to fefea6bCompareApril 8, 2017 22:44
@refack

Copy link
Copy Markdown
ContributorAuthor

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

@refackrefack closed this Apr 14, 2017
@refackrefack removed their assignment Jun 12, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

buildIssues and PRs related to build files or the CI.windowsIssues and PRs related to the Windows platform.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@refack@gibfahn@nodejs-github-bot