Skip to content

Commit 8bbbda5

Browse files
seishunjasnell
authored andcommitted
build: use generic names for linting tasks
"jslint" is the name of a tool that actually is not used, which can cause confusion. PR-URL: #15272 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]>
1 parent 5e043a6 commit 8bbbda5

File tree

3 files changed

+56
-45
lines changed

3 files changed

+56
-45
lines changed

Makefile

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -880,26 +880,32 @@ bench: bench-net bench-http bench-fs bench-tls
880880

881881
bench-ci: bench
882882

883-
JSLINT_TARGETS = benchmark doc lib test tools
883+
LINT_JS_TARGETS = benchmark doc lib test tools
884884

885-
jslint:
885+
lint-js:
886886
@echo "Running JS linter..."
887887
$(NODE) tools/eslint/bin/eslint.js --cache --rulesdir=tools/eslint-rules --ext=.js,.mjs,.md \
888-
$(JSLINT_TARGETS)
888+
$(LINT_JS_TARGETS)
889889

890-
jslint-ci:
890+
jslint: lint-js
891+
@echo "Please use lint-js instead of jslint"
892+
893+
lint-js-ci:
891894
@echo "Running JS linter..."
892-
$(NODE) tools/jslint.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \
893-
$(JSLINT_TARGETS)
895+
$(NODE) tools/lint-js.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \
896+
$(LINT_JS_TARGETS)
897+
898+
jslint-ci: lint-js-ci
899+
@echo "Please use lint-js-ci instead of jslint-ci"
894900

895-
CPPLINT_EXCLUDE ?=
896-
CPPLINT_EXCLUDE += src/node_root_certs.h
897-
CPPLINT_EXCLUDE += $(wildcard test/addons/??_*/*.cc test/addons/??_*/*.h)
898-
CPPLINT_EXCLUDE += $(wildcard test/addons-napi/??_*/*.cc test/addons-napi/??_*/*.h)
901+
LINT_CPP_EXCLUDE ?=
902+
LINT_CPP_EXCLUDE += src/node_root_certs.h
903+
LINT_CPP_EXCLUDE += $(wildcard test/addons/??_*/*.cc test/addons/??_*/*.h)
904+
LINT_CPP_EXCLUDE += $(wildcard test/addons-napi/??_*/*.cc test/addons-napi/??_*/*.h)
899905
# These files were copied more or less verbatim from V8.
900-
CPPLINT_EXCLUDE += src/tracing/trace_event.h src/tracing/trace_event_common.h
906+
LINT_CPP_EXCLUDE += src/tracing/trace_event.h src/tracing/trace_event_common.h
901907

902-
CPPLINT_FILES = $(filter-out $(CPPLINT_EXCLUDE), $(wildcard \
908+
LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \
903909
src/*.c \
904910
src/*.cc \
905911
src/*.h \
@@ -917,19 +923,22 @@ CPPLINT_FILES = $(filter-out $(CPPLINT_EXCLUDE), $(wildcard \
917923
tools/icu/*.h \
918924
))
919925

920-
cpplint:
926+
lint-cpp:
921927
@echo "Running C++ linter..."
922-
@$(PYTHON) tools/cpplint.py $(CPPLINT_FILES)
928+
@$(PYTHON) tools/cpplint.py $(LINT_CPP_FILES)
923929
@$(PYTHON) tools/check-imports.py
924930

931+
cpplint: lint-cpp
932+
@echo "Please use lint-cpp instead of cpplint"
933+
925934
ifneq ("","$(wildcard tools/eslint/)")
926935
lint:
927936
@EXIT_STATUS=0 ; \
928-
$(MAKE) jslint || EXIT_STATUS=$$? ; \
929-
$(MAKE) cpplint || EXIT_STATUS=$$? ; \
937+
$(MAKE) lint-js || EXIT_STATUS=$$? ; \
938+
$(MAKE) lint-cpp || EXIT_STATUS=$$? ; \
930939
exit $$EXIT_STATUS
931940
CONFLICT_RE=^>>>>>>> [0-9A-Fa-f]+|^<<<<<<< [A-Za-z]+
932-
lint-ci: jslint-ci cpplint
941+
lint-ci: lint-js-ci lint-cpp
933942
@if ! ( grep -IEqrs "$(CONFLICT_RE)" benchmark deps doc lib src test tools ) \
934943
&& ! ( find . -maxdepth 1 -type f | xargs grep -IEqs "$(CONFLICT_RE)" ); then \
935944
exit 0 ; \
@@ -976,7 +985,6 @@ endif
976985
coverage-build \
977986
coverage-clean \
978987
coverage-test \
979-
cpplint \
980988
dist \
981989
distclean \
982990
doc \
@@ -987,10 +995,11 @@ endif
987995
install \
988996
install-bin \
989997
install-includes \
990-
jslint \
991-
jslint-ci \
992998
lint \
993999
lint-ci \
1000+
lint-cpp \
1001+
lint-js \
1002+
lint-js-ci \
9941003
list-gtests \
9951004
pkg \
9961005
release-only \

tools/jslint.js renamed to tools/lint-js.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ if (cluster.isMaster) {
5959
throw new Error('Bad parallel job count');
6060
}
6161

62-
// Check for custom JSLint report formatter
62+
// Check for custom ESLint report formatter
6363
i = process.argv.indexOf('-f');
6464
if (i !== -1) {
6565
if (!process.argv[i + 1])
@@ -77,7 +77,7 @@ if (cluster.isMaster) {
7777
formatter = cli.getFormatter();
7878
}
7979

80-
// Check if outputting JSLint report to a file instead of stdout
80+
// Check if outputting ESLint report to a file instead of stdout
8181
i = process.argv.indexOf('-o');
8282
if (i !== -1) {
8383
if (!process.argv[i + 1])

vcbuild.bat

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ set package=
2626
set msi=
2727
set upload=
2828
set licensertf=
29-
set jslint=
30-
set cpplint=
29+
set lint_js=
30+
set lint_cpp=
3131
set build_testgc_addon=
3232
set noetw=
3333
set noetw_msi_arg=
@@ -72,7 +72,7 @@ if /i "%1"=="nosnapshot" set nosnapshot=1&goto arg-ok
7272
if /i "%1"=="noetw" set noetw=1&goto arg-ok
7373
if /i "%1"=="noperfctr" set noperfctr=1&goto arg-ok
7474
if /i "%1"=="licensertf" set licensertf=1&goto arg-ok
75-
if /i "%1"=="test" set test_args=%test_args% -J %common_test_suites%&set cpplint=1&set jslint=1&goto arg-ok
75+
if /i "%1"=="test" set test_args=%test_args% -J %common_test_suites%&set lint_cpp=1&set lint_js=1&goto arg-ok
7676
if /i "%1"=="test-ci" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap %common_test_suites%&set cctest_args=%cctest_args% --gtest_output=tap:cctest.tap&goto arg-ok
7777
if /i "%1"=="test-addons" set test_args=%test_args% addons&set build_addons=1&goto arg-ok
7878
if /i "%1"=="test-addons-napi" set test_args=%test_args% addons-napi&set build_addons_napi=1&goto arg-ok
@@ -85,17 +85,19 @@ if /i "%1"=="test-internet" set test_args=%test_args% internet&goto arg-ok
8585
if /i "%1"=="test-pummel" set test_args=%test_args% pummel&goto arg-ok
8686
if /i "%1"=="test-known-issues" set test_args=%test_args% known_issues&goto arg-ok
8787
if /i "%1"=="test-async-hooks" set test_args=%test_args% async-hooks&goto arg-ok
88-
if /i "%1"=="test-all" set test_args=%test_args% gc internet pummel %common_test_suites%&set build_testgc_addon=1&set cpplint=1&set jslint=1&goto arg-ok
88+
if /i "%1"=="test-all" set test_args=%test_args% gc internet pummel %common_test_suites%&set build_testgc_addon=1&set lint_cpp=1&set lint_js=1&goto arg-ok
8989
if /i "%1"=="test-node-inspect" set test_node_inspect=1&goto arg-ok
9090
if /i "%1"=="test-check-deopts" set test_check_deopts=1&goto arg-ok
9191
if /i "%1"=="test-v8" set test_v8=1&set custom_v8_test=1&goto arg-ok
9292
if /i "%1"=="test-v8-intl" set test_v8_intl=1&set custom_v8_test=1&goto arg-ok
9393
if /i "%1"=="test-v8-benchmarks" set test_v8_benchmarks=1&set custom_v8_test=1&goto arg-ok
9494
if /i "%1"=="test-v8-all" set test_v8=1&set test_v8_intl=1&set test_v8_benchmarks=1&set custom_v8_test=1&goto arg-ok
95-
if /i "%1"=="jslint" set jslint=1&goto arg-ok
96-
if /i "%1"=="jslint-ci" set jslint_ci=1&goto arg-ok
97-
if /i "%1"=="lint" set cpplint=1&set jslint=1&goto arg-ok
98-
if /i "%1"=="lint-ci" set cpplint=1&set jslint_ci=1&goto arg-ok
95+
if /i "%1"=="lint-js" set lint_js=1&goto arg-ok
96+
if /i "%1"=="jslint" set lint_js=1&echo Please use lint-js instead of jslint&goto arg-ok
97+
if /i "%1"=="lint-js-ci" set lint_js_ci=1&goto arg-ok
98+
if /i "%1"=="jslint-ci" set lint_js_ci=1&echo Please use lint-js-ci instead of jslint-ci&goto arg-ok
99+
if /i "%1"=="lint" set lint_cpp=1&set lint_js=1&goto arg-ok
100+
if /i "%1"=="lint-ci" set lint_cpp=1&set lint_js_ci=1&goto arg-ok
99101
if /i "%1"=="package" set package=1&goto arg-ok
100102
if /i "%1"=="msi" set msi=1&set licensertf=1&set download_arg="--download=all"&set i18n_arg=small-icu&goto arg-ok
101103
if /i "%1"=="build-release" set build_release=1&set sign=1&goto arg-ok
@@ -457,20 +459,20 @@ if defined enable_static goto test-v8
457459
call :run-python tools\test.py %test_args%
458460

459461
:test-v8
460-
if not defined custom_v8_test goto cpplint
462+
if not defined custom_v8_test goto lint-cpp
461463
call tools/test-v8.bat
462464
if errorlevel 1 goto exit
463-
goto cpplint
465+
goto lint-cpp
464466

465-
:cpplint
466-
if not defined cpplint goto jslint
467-
call :run-cpplint 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
467+
:lint-cpp
468+
if not defined lint_cpp goto lint-js
469+
call :run-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
468470
call :run-python tools/check-imports.py
469-
goto jslint
471+
goto lint-js
470472

471-
:run-cpplint
473+
:run-lint-cpp
472474
if "%*"=="" goto exit
473-
echo running cpplint '%*'
475+
echo running lint-cpp '%*'
474476
set cppfilelist=
475477
setlocal enabledelayedexpansion
476478
for /f "tokens=*" %%G in ('dir /b /s /a %*') do (
@@ -501,18 +503,18 @@ if %errorlevel% equ 0 goto exit
501503
set "localcppfilelist=%localcppfilelist% %1"
502504
goto exit
503505

504-
:jslint
506+
:lint-js
505507
if defined enable_static goto exit
506-
if defined jslint_ci goto jslint-ci
507-
if not defined jslint goto exit
508+
if defined lint_js_ci goto lint-js-ci
509+
if not defined lint_js goto exit
508510
if not exist tools\eslint goto no-lint
509-
echo running jslint
511+
echo running lint-js
510512
%config%\node tools\eslint\bin\eslint.js --cache --rule "linebreak-style: 0" --rulesdir=tools\eslint-rules --ext=.js,.md benchmark doc lib test tools
511513
goto exit
512514

513-
:jslint-ci
514-
echo running jslint-ci
515-
%config%\node tools\jslint.js -J -f tap -o test-eslint.tap benchmark doc lib test tools
515+
:lint-js-ci
516+
echo running lint-js-ci
517+
%config%\node tools\lint-js.js -J -f tap -o test-eslint.tap benchmark doc lib test tools
516518
goto exit
517519

518520
:no-lint

0 commit comments

Comments
 (0)