summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorChengzhong Wu <chengzhong.wcz@alibaba-inc.com>2023-02-24 18:01:27 +0800
committerGitHub <noreply@github.com>2023-02-24 10:01:27 +0000
commitc6f23ee9373286de1f49ea5bd004710cc779302b (patch)
tree299df7fff63485b01c67565bb9a22eab37e79660 /Makefile
parentd953049a71f78de4b0e13d5652dcb2e88eda0f94 (diff)
downloadnode-new-c6f23ee9373286de1f49ea5bd004710cc779302b.tar.gz
tools: run format-cpp on node-api test c files
PR-URL: https://github.com/nodejs/node/pull/46694 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 11 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 85849c01df..0be0659d37 100644
--- a/Makefile
+++ b/Makefile
@@ -1414,7 +1414,6 @@ LINT_CPP_ADDON_DOC_FILES = $(wildcard $(LINT_CPP_ADDON_DOC_FILES_GLOB))
LINT_CPP_EXCLUDE ?=
LINT_CPP_EXCLUDE += src/node_root_certs.h
LINT_CPP_EXCLUDE += $(LINT_CPP_ADDON_DOC_FILES)
-LINT_CPP_EXCLUDE += $(wildcard test/js-native-api/??_*/*.cc test/js-native-api/??_*/*.h test/node-api/??_*/*.cc test/node-api/??_*/*.h)
# These files were copied more or less verbatim from V8.
LINT_CPP_EXCLUDE += src/tracing/trace_event.h src/tracing/trace_event_common.h
@@ -1434,9 +1433,7 @@ LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \
test/embedding/*.h \
test/fixtures/*.c \
test/js-native-api/*/*.cc \
- test/js-native-api/*/*.h \
test/node-api/*/*.cc \
- test/node-api/*/*.h \
tools/icu/*.cc \
tools/icu/*.h \
tools/code_cache/*.cc \
@@ -1445,6 +1442,16 @@ LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \
tools/snapshot/*.h \
))
+FORMAT_CPP_FILES ?=
+FORMAT_CPP_FILES += $(LINT_CPP_FILES)
+# C source codes.
+FORMAT_CPP_FILES += $(wildcard \
+ test/js-native-api/*/*.c \
+ test/js-native-api/*/*.h \
+ test/node-api/*/*.c \
+ test/node-api/*/*.h \
+ )
+
# Code blocks don't have newline at the end,
# and the actual filename is generated so it won't match header guards
ADDON_DOC_LINT_FLAGS=-whitespace/ending_newline,-build/header_guard
@@ -1473,7 +1480,7 @@ ifneq ("","$(wildcard tools/clang-format/node_modules/)")
--binary=tools/clang-format/node_modules/.bin/clang-format \
--style=file \
$(CLANG_FORMAT_START) -- \
- $(LINT_CPP_FILES)
+ $(FORMAT_CPP_FILES)
else
$(info Required tooling for C++ code formatting is not installed.)
$(info To install (requires internet access) run: $$ make format-cpp-build)