@@ -593,51 +593,17 @@ goto lint-cpp
593
593
594
594
:lint-cpp
595
595
if not defined lint_cpp goto lint-js
596
- call :run-lint-cpp src\*.c src\*.cc src\*.h test\addons\*.cc test\addons\*.h test\js-native-api\*.cc test\js-native-api\*.cc test\js-native-api\*.h test\node-api\*.cc test\node-api\*.cc test\node-api\*.h test\cctest\*.cc test\cctest\*.h tools\icu\*.cc tools\icu\*.h
597
- python tools/check-imports.py
596
+ if defined NODEJS_MAKE goto run-make-lint
597
+ where make > NUL 2 >& 1 && make -v | findstr /C:" GNU Make" 1 > NUL
598
+ if " %ERRORLEVEL% " == " 0" set " NODEJS_MAKE = make PYTHON=python" & goto run-make-lint
599
+ where wsl > NUL 2 > 1
600
+ if " %ERRORLEVEL% " == " 0" set " NODEJS_MAKE = wsl make" & goto run-make-lint
601
+ echo Could not find GNU Make, needed for linting C/C++
598
602
goto lint-js
599
603
600
- :run-lint-cpp
601
- if " %* " == " " goto exit
602
- echo running lint-cpp '%* '
603
- set cppfilelist =
604
- setlocal enabledelayedexpansion
605
- for /f " tokens=*" %%G in ('dir /b /s /a %* ') do (
606
- set relpath = %%G
607
- set relpath = !relpath:* %~dp0 =!
608
- call :add-to-list !relpath! > nul
609
- )
610
- ( endlocal
611
- set cppfilelist = %localcppfilelist%
612
- )
613
- python tools/cpplint.py %cppfilelist% > nul
614
- goto exit
615
-
616
- :add-to-list
617
- @ rem Subroutine used to filter items from the cpplint file list
618
- echo %1 | findstr /c:" src\node_root_certs.h" > nul 2 >& 1
619
- if %errorlevel% equ 0 goto exit
620
-
621
- echo %1 | findstr /c:" src\tracing\trace_event.h" > nul 2 >& 1
622
- if %errorlevel% equ 0 goto exit
623
-
624
- echo %1 | findstr /c:" src\tracing\trace_event_common.h" > nul 2 >& 1
625
- if %errorlevel% equ 0 goto exit
626
-
627
- echo %1 | findstr /r /c:" test\\addons\\[0-9].*_.*\.h" > nul 2 >& 1
628
- if %errorlevel% equ 0 goto exit
629
-
630
- echo %1 | findstr /r /c:" test\\addons\\[0-9].*_.*\.cc" > nul 2 >& 1
631
- if %errorlevel% equ 0 goto exit
632
-
633
- echo %1 | findstr /c:" test\js-native-api\common.h" > nul 2 >& 1
634
- if %errorlevel% equ 0 goto exit
635
-
636
- echo %1 | findstr /c:" test\node-api\common.h" > nul 2 >& 1
637
- if %errorlevel% equ 0 goto exit
638
-
639
- set " localcppfilelist = %localcppfilelist% %1 "
640
- goto exit
604
+ :run-make-lint
605
+ %NODEJS_MAKE% lint-cpp
606
+ goto lint-js
641
607
642
608
:lint-js
643
609
if defined lint_js_ci goto lint-js-ci
0 commit comments