build: split up cpplint to avoid long cmd lines · nodejs/node@14cc1ab

Original file line numberDiff line numberDiff line change

@@ -72,6 +72,7 @@ if /i "%1"=="test-all" set test_args=%test_args% sequential parallel messag

7272

if /i "%1"=="test-known-issues" set test_args=%test_args% known_issues&goto arg-ok

7373

if /i "%1"=="jslint" set jslint=1&goto arg-ok

7474

if /i "%1"=="jslint-ci" set jslint_ci=1&goto arg-ok

75+

if /i "%1"=="cpplint" set cpplint=1&goto arg-ok

7576

if /i "%1"=="lint" set cpplint=1&set jslint=1&goto arg-ok

7677

if /i "%1"=="lint-ci" set cpplint=1&set jslint_ci=1&goto arg-ok

7778

if /i "%1"=="package" set package=1&goto arg-ok

@@ -347,22 +348,25 @@ goto cpplint

347348
348349

:cpplint

349350

if not defined cpplint goto jslint

350-

echo running cpplint

351+

call :run-cpplint src\*.c src\*.cc src\*.h test\addons\*.cc test\addons\*.h test\cctest\*.cc test\cctest\*.h tools\icu\*.cc tools\icu\*.h

352+

call :run-python tools/check-imports.py

353+

goto jslint

354+
355+

:run-cpplint

356+

if "%*"=="" goto exit

357+

echo running cpplint '%*'

351358

set cppfilelist=

352359

setlocal enabledelayedexpansion

353-

for /f "tokens=*" %%G in ('dir /b /s /a src\*.c src\*.cc src\*.h ^

354-

test\addons\*.cc test\addons\*.h test\cctest\*.cc test\cctest\*.h ^

355-

test\gc\binding.cc tools\icu\*.cc tools\icu\*.h') do (

360+

for /f "tokens=*" %%G in ('dir /b /s /a %*') do (

356361

set relpath=%%G

357362

set relpath=!relpath:*%~dp0=!

358363

call :add-to-list !relpath!

359364

)

360365

( endlocal

361366

set cppfilelist=%localcppfilelist%

362367

)

363-

python tools/cpplint.py %cppfilelist%

364-

python tools/check-imports.py

365-

goto jslint

368+

call :run-python tools/cpplint.py %cppfilelist%

369+

goto exit

366370
367371

:add-to-list

368372

echo %1 | findstr /c:"src\node_root_certs.h"