Skip to content

Commit c9ec12d

Browse files
danbevtargos
authored andcommitted
build,win: enable lint option to run "standalone"
This commit adds support to run the linter without running any other targets. This commit also makes the lint task a little more quite and more inline with the output on other operating systems. Below is an example of running (with a lint error to show that it is not so quite that errors are hidden): C:\Users\danbev\working\node>vcbuild.bat lint running lint-cpp 'src\*.c src\*.cc src\*.h test\addons\*.cc test\addons\*.h test\cctest\*.cc test\cctest\*.h test\gc\binding.cc tools\icu\*.cc tools\icu\*.h' src\env.h:24: Should have a space between // and comment [whitespace/comments] [4] Total errors found: 1 "C:\Python27\python.exe" tools/check-imports.py running lint-js The help message now looks like: C:\Users\danbev\working\node>vcbuild.bat /? vcbuild.bat [debug/release] [msi] [test/test-ci/test-all/test-uv/ test-inspector/test-internet/test-pummel/test-simple/test-message/ test-async-hooks/test-v8/test-v8-intl/test-v8-benchmarks/ test-v8-all] [clean] [noprojgen] [small-icu/full-icu/without-intl] [nobuild] [sign] [x86/x64] [vs2015/vs2017] [download-all] [enable-vtune] [lint/lint-ci] [no-NODE-OPTIONS] [link-module path-to-module] Examples: vcbuild.bat : builds release build vcbuild.bat debug : builds debug build vcbuild.bat release msi : builds release build and MSI installer package vcbuild.bat test : builds debug build and runs tests vcbuild.bat build-release : builds the release distribution as used by nodejs.org vcbuild.bat enable-vtune : builds nodejs with Intel VTune profiling support to profile JavaScript vcbuild.bat link-module my_module.js : bundles my_module as built-in module vcbuild.bat lint : runs the C++ and JavaScript linter PR-URL: #16176 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
1 parent 8a8e5c7 commit c9ec12d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

vcbuild.bat

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ goto next-arg
129129

130130
:args-done
131131

132+
if "%*"=="lint" (
133+
goto lint-cpp
134+
)
135+
132136
if defined build_release (
133137
set config=Release
134138
set package=1
@@ -480,12 +484,12 @@ setlocal enabledelayedexpansion
480484
for /f "tokens=*" %%G in ('dir /b /s /a %*') do (
481485
set relpath=%%G
482486
set relpath=!relpath:*%~dp0=!
483-
call :add-to-list !relpath!
487+
call :add-to-list !relpath! > nul
484488
)
485489
( endlocal
486490
set cppfilelist=%localcppfilelist%
487491
)
488-
call :run-python tools/cpplint.py %cppfilelist%
492+
call :run-python tools/cpplint.py %cppfilelist% > nul
489493
goto exit
490494

491495
:add-to-list
@@ -541,6 +545,7 @@ echo vcbuild.bat test : builds debug build and runs tests
541545
echo vcbuild.bat build-release : builds the release distribution as used by nodejs.org
542546
echo vcbuild.bat enable-vtune : builds nodejs with Intel VTune profiling support to profile JavaScript
543547
echo vcbuild.bat link-module my_module.js : bundles my_module as built-in module
548+
echo vcbuild.bat lint : runs the C++ and JavaScript linter
544549
goto exit
545550

546551
:run-python

0 commit comments

Comments
 (0)