Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: run format-cpp on node-api test c files #46694

Merged
merged 1 commit into from
Feb 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,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

Expand All @@ -1425,9 +1424,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 \
Expand All @@ -1436,6 +1433,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 \
joyeecheung marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down Expand Up @@ -1464,7 +1471,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)
Expand Down