Skip to content

Commit 252d08a

Browse files
seishunMylesBorins
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. Backport-PR-URL: #16297 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 1898779 commit 252d08a

File tree

3 files changed

+51
-42
lines changed

3 files changed

+51
-42
lines changed

‎Makefile‎

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -753,23 +753,27 @@ bench-idle:
753753
sleep 1
754754
$(NODE) benchmark/idle_clients.js &
755755

756-
jslint:
756+
lint-js:
757757
@echo "Running JS linter..."
758758
$(NODE) tools/eslint/bin/eslint.js --cache --rulesdir=tools/eslint-rules --ext=.js,.md \
759759
benchmark doc lib test tools
760760

761-
jslint-ci:
761+
jslint: lint-js
762+
763+
lint-js-ci:
762764
@echo "Running JS linter..."
763-
$(NODE) tools/jslint.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \
765+
$(NODE) tools/lint-js.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \
764766
benchmark doc lib test tools
765767

766-
CPPLINT_EXCLUDE ?=
767-
CPPLINT_EXCLUDE += src/node_root_certs.h
768-
CPPLINT_EXCLUDE += src/queue.h
769-
CPPLINT_EXCLUDE += src/tree.h
770-
CPPLINT_EXCLUDE += $(wildcard test/addons/??_*/*.cc test/addons/??_*/*.h)
768+
jslint-ci: lint-js-ci
769+
770+
LINT_CPP_EXCLUDE ?=
771+
LINT_CPP_EXCLUDE += src/node_root_certs.h
772+
LINT_CPP_EXCLUDE += src/queue.h
773+
LINT_CPP_EXCLUDE += src/tree.h
774+
LINT_CPP_EXCLUDE += $(wildcard test/addons/??_*/*.cc test/addons/??_*/*.h)
771775

772-
CPPLINT_FILES = $(filter-out$(CPPLINT_EXCLUDE), $(wildcard \
776+
LINT_CPP_FILES = $(filter-out$(LINT_CPP_EXCLUDE), $(wildcard \
773777
src/*.c \
774778
src/*.cc \
775779
src/*.h \
@@ -781,19 +785,21 @@ CPPLINT_FILES = $(filter-out $(CPPLINT_EXCLUDE), $(wildcard \
781785
tools/icu/*.h \
782786
))
783787

784-
cpplint:
788+
lint-cpp:
785789
@echo "Running C++ linter..."
786-
@$(PYTHON) tools/cpplint.py $(CPPLINT_FILES)
790+
@$(PYTHON) tools/cpplint.py $(LINT_CPP_FILES)
787791
@$(PYTHON) tools/check-imports.py
788792

793+
cpplint: lint-cpp
794+
789795
ifneq ("","$(wildcard tools/eslint/)")
790796
lint:
791797
@EXIT_STATUS=0 ;\
792-
$(MAKE)jslint|| EXIT_STATUS=$$?;\
793-
$(MAKE)cpplint|| EXIT_STATUS=$$?;\
798+
$(MAKE)lint-js|| EXIT_STATUS=$$?;\
799+
$(MAKE)lint-cpp|| EXIT_STATUS=$$?;\
794800
exit$$EXIT_STATUS
795801
CONFLICT_RE=^>>>>>>> [0-9A-Fa-f]+|^<<<<<<< [A-Za-z]+
796-
lint-ci: jslint-ci cpplint
802+
lint-ci: lint-js-ci lint-cpp
797803
@if ! ( grep -IEqrs "$(CONFLICT_RE)" benchmark deps doc lib src test tools ) \
798804
&&! ( find . -maxdepth 1 -type f | xargs grep -IEqs "$(CONFLICT_RE)" );then\
799805
exit 0 ;\
@@ -811,13 +817,13 @@ lint:
811817
lint-ci: lint
812818
endif
813819

814-
.PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean \
820+
.PHONY: lint lint-cpp lint-js bench clean docopen docclean doc dist distclean \
815821
check uninstall install install-includes install-bin all staticlib \
816822
dynamiclib test test-all test-addons test-addons-clean build-addons \
817823
website-upload pkg blog blogclean tar binary release-only \
818824
bench-http-simple bench-idle bench-all bench bench-misc bench-array \
819825
bench-buffer bench-net bench-http bench-fs bench-tls cctest run-ci \
820826
test-v8 test-v8-intl test-v8-benchmarks test-v8-all v8 lint-ci \
821-
bench-ci jslint-ci doc-only $(TARBALL)-headers test-ci test-ci-native \
827+
bench-ci lint-js-ci doc-only $(TARBALL)-headers test-ci test-ci-native \
822828
test-ci-js build-ci test-hash-seed clear-stalled
823829

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
thrownewError('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: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ set package=
2626
setmsi=
2727
setupload=
2828
setlicensertf=
29-
setjslint=
30-
setcpplint=
29+
setlint_js=
30+
setlint_cpp=
3131
setbuildnodeweak=
3232
setnoetw=
3333
setnoetw_msi_arg=
@@ -58,7 +58,7 @@ if /i "%1"=="nosnapshot" set nosnapshot=1&goto arg-ok
5858
if /i "%1"=="noetw"setnoetw=1&goto arg-ok
5959
if /i "%1"=="noperfctr"setnoperfctr=1&goto arg-ok
6060
if /i "%1"=="licensertf"setlicensertf=1&goto arg-ok
61-
if /i "%1"=="test"settest_args=%test_args% doctool known_issues message parallel sequential addons -J&set cpplint=1&set jslint=1&set build_addons=1&goto arg-ok
61+
if /i "%1"=="test"settest_args=%test_args% doctool known_issues message parallel sequential addons -J&set lint_cpp=1&set lint_js=1&set build_addons=1&goto arg-ok
6262
if /i "%1"=="test-ci"settest_args=%test_args%%test_ci_args% -p tap --logfile test.tap doctool inspector known_issues message sequential parallel addons&set cctest_args=%cctest_args% --gtest_output=tap:cctest.tap&set build_addons=1&goto arg-ok
6363
if /i "%1"=="test-addons"settest_args=%test_args% addons&set build_addons=1&goto arg-ok
6464
if /i "%1"=="test-simple"settest_args=%test_args% sequential parallel -J&goto arg-ok
@@ -68,13 +68,16 @@ if /i "%1"=="test-inspector" set test_args=%test_args% inspector&goto arg-ok
6868
if /i "%1"=="test-tick-processor"settest_args=%test_args% tick-processor&goto arg-ok
6969
if /i "%1"=="test-internet"settest_args=%test_args% internet&goto arg-ok
7070
if /i "%1"=="test-pummel"settest_args=%test_args% pummel&goto arg-ok
71-
if /i "%1"=="test-all"settest_args=%test_args% sequential parallel message gc inspector internet pummel&set buildnodeweak=1&set cpplint=1&set jslint=1&goto arg-ok
71+
if /i "%1"=="test-all"settest_args=%test_args% sequential parallel message gc inspector internet pummel&set buildnodeweak=1&set lint_cpp=1&set lint_js=1&goto arg-ok
7272
if /i "%1"=="test-known-issues"settest_args=%test_args% known_issues&goto arg-ok
73-
if /i "%1"=="jslint"setjslint=1&goto arg-ok
74-
if /i "%1"=="jslint-ci"setjslint_ci=1&goto arg-ok
75-
if /i "%1"=="cpplint"setcpplint=1&goto arg-ok
76-
if /i "%1"=="lint"setcpplint=1&set jslint=1&goto arg-ok
77-
if /i "%1"=="lint-ci"setcpplint=1&set jslint_ci=1&goto arg-ok
73+
if /i "%1"=="lint-js"setlint_js=1&goto arg-ok
74+
if /i "%1"=="jslint"setlint_js=1&goto arg-ok
75+
if /i "%1"=="lint-js-ci"setlint_js_ci=1&goto arg-ok
76+
if /i "%1"=="jslint-ci"setlint_js_ci=1&goto arg-ok
77+
if /i "%1"=="lint-cpp"setlint_cpp=1&goto arg-ok
78+
if /i "%1"=="cpplint"setlint_cpp=1&goto arg-ok
79+
if /i "%1"=="lint"setlint_cpp=1&set lint_js=1&goto arg-ok
80+
if /i "%1"=="lint-ci"setlint_cpp=1&set lint_js_ci=1&goto arg-ok
7881
if /i "%1"=="package"setpackage=1&goto arg-ok
7982
if /i "%1"=="msi"setmsi=1&set licensertf=1&set download_arg="--download=all"&set i18n_arg=small-icu&goto arg-ok
8083
if /i "%1"=="build-release"setbuild_release=1&goto arg-ok
@@ -340,23 +343,23 @@ endlocal
340343
goto run-tests
341344

342345
:run-tests
343-
if"%test_args%"==""gotocpplint
346+
if"%test_args%"==""gotolint-cpp
344347
if"%config%"=="Debug"settest_args=--mode=debug %test_args%
345348
if"%config%"=="Release"settest_args=--mode=release %test_args%
346349
echo running 'cctest %cctest_args%'
347350
"%config%\cctest"%cctest_args%
348351
call :run-python tools\test.py %test_args%
349-
gotocpplint
352+
gotolint-cpp
350353

351-
:cpplint
352-
ifnotdefinedcpplintgotojslint
353-
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
354+
:lint-cpp
355+
ifnotdefinedlint_cppgotolint-js
356+
call :run-lint-cpp src\*.c src\*.cc src\*.h test\addons\*.cc test\addons\*.h test\cctest\*.cc test\cctest\*.h tools\icu\*.cc tools\icu\*.h
354357
call :run-python tools/check-imports.py
355-
gotojslint
358+
gotolint-js
356359

357-
:run-cpplint
360+
:run-lint-cpp
358361
if"%*"==""gotoexit
359-
echo running cpplint '%*'
362+
echo running lint-cpp '%*'
360363
setcppfilelist=
361364
setlocalenabledelayedexpansion
362365
for /f "tokens=*"%%Gin ('dir /b /s /a %*') do (
@@ -393,17 +396,17 @@ if %errorlevel% equ 0 goto exit
393396
set"localcppfilelist=%localcppfilelist%%1"
394397
gotoexit
395398

396-
:jslint
397-
ifdefinedjslint_cigotojslint-ci
398-
ifnotdefinedjslintgotoexit
399+
:lint-js
400+
ifdefinedlint_js_cigotolint-js-ci
401+
ifnotdefinedlint_jsgotoexit
399402
ifnotexist tools\eslint goto no-lint
400-
echo running jslint
403+
echo running lint-js
401404
%config%\node tools\eslint\bin\eslint.js --cache --rule "linebreak-style: 0" --rulesdir=tools\eslint-rules --ext=.js,.md benchmark doc lib test tools
402405
gotoexit
403406

404-
:jslint-ci
405-
echo running jslint-ci
406-
%config%\node tools\jslint.js -J -f tap -o test-eslint.tap benchmark doc lib test tools
407+
:lint-js-ci
408+
echo running lint-js-ci
409+
%config%\node tools\lint-js.js -J -f tap -o test-eslint.tap benchmark doc lib test tools
407410
gotoexit
408411

409412
:no-lint

0 commit comments

Comments
(0)