Skip to content

Commit f3c1192

Browse files
committed
tools: run format-cpp on node-api test c files
1 parent 825efe5 commit f3c1192

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Makefile

+11-4
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,6 @@ LINT_CPP_ADDON_DOC_FILES = $(wildcard $(LINT_CPP_ADDON_DOC_FILES_GLOB))
14051405
LINT_CPP_EXCLUDE ?=
14061406
LINT_CPP_EXCLUDE += src/node_root_certs.h
14071407
LINT_CPP_EXCLUDE += $(LINT_CPP_ADDON_DOC_FILES)
1408-
LINT_CPP_EXCLUDE += $(wildcard test/js-native-api/??_*/*.cc test/js-native-api/??_*/*.h test/node-api/??_*/*.cc test/node-api/??_*/*.h)
14091408
# These files were copied more or less verbatim from V8.
14101409
LINT_CPP_EXCLUDE += src/tracing/trace_event.h src/tracing/trace_event_common.h
14111410

@@ -1425,9 +1424,7 @@ LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \
14251424
test/embedding/*.h \
14261425
test/fixtures/*.c \
14271426
test/js-native-api/*/*.cc \
1428-
test/js-native-api/*/*.h \
14291427
test/node-api/*/*.cc \
1430-
test/node-api/*/*.h \
14311428
tools/icu/*.cc \
14321429
tools/icu/*.h \
14331430
tools/code_cache/*.cc \
@@ -1436,6 +1433,16 @@ LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \
14361433
tools/snapshot/*.h \
14371434
))
14381435

1436+
FORMAT_CPP_FILES ?=
1437+
FORMAT_CPP_FILES += $(LINT_CPP_FILES)
1438+
# C source codes.
1439+
FORMAT_CPP_FILES += $(wildcard \
1440+
test/js-native-api/*/*.c \
1441+
test/js-native-api/*/*.h \
1442+
test/node-api/*/*.c \
1443+
test/node-api/*/*.h \
1444+
)
1445+
14391446
# Code blocks don't have newline at the end,
14401447
# and the actual filename is generated so it won't match header guards
14411448
ADDON_DOC_LINT_FLAGS=-whitespace/ending_newline,-build/header_guard
@@ -1464,7 +1471,7 @@ ifneq ("","$(wildcard tools/clang-format/node_modules/)")
14641471
--binary=tools/clang-format/node_modules/.bin/clang-format \
14651472
--style=file \
14661473
$(CLANG_FORMAT_START) -- \
1467-
$(LINT_CPP_FILES)
1474+
$(FORMAT_CPP_FILES)
14681475
else
14691476
$(info Required tooling for C++ code formatting is not installed.)
14701477
$(info To install (requires internet access) run: $$ make format-cpp-build)

0 commit comments

Comments
 (0)