diff options
-rw-r--r-- | .github/workflows/main.yaml | 4 | ||||
-rw-r--r-- | Makefile.in | 6 | ||||
-rw-r--r-- | erts/emulator/Makefile.in | 4 | ||||
-rw-r--r-- | make/run_make.mk | 2 |
4 files changed, 12 insertions, 4 deletions
diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 68a062a365..c2fb0d5197 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -106,6 +106,10 @@ jobs: name: otp_doc_man path: otp_doc_man.tar.gz + ## Check formatting of cpp code + - if: matrix.type == '64-bit' + name: Check format + run: docker run -v $PWD/scripts:/scripts otp "make format-check" ## Run dialyzer - if: matrix.type == '64-bit' name: Run dialyzer diff --git a/Makefile.in b/Makefile.in index f8faea1290..aa6dc82419 100644 --- a/Makefile.in +++ b/Makefile.in @@ -533,8 +533,10 @@ compdb: (cd erts/emulator && ERL_TOP=$(ERL_TOP) TYPE=$(TYPE) $(MAKE) compdb) sed -i -e '1s/^/[\n/' -e '$$s/,$$/\n]/' $(ERL_TOP)/compile_commands.json -clang_format: - (cd erts/emulator && ERL_TOP=$(ERL_TOP) $(MAKE) clang_format) +format-check: + (cd erts/emulator && ERL_TOP=$(ERL_TOP) $(MAKE) format-check) +format: + (cd erts/emulator && ERL_TOP=$(ERL_TOP) $(MAKE) format) dep depend: $(make_verbose) diff --git a/erts/emulator/Makefile.in b/erts/emulator/Makefile.in index ba35d50a86..f21908cace 100644 --- a/erts/emulator/Makefile.in +++ b/erts/emulator/Makefile.in @@ -1509,7 +1509,9 @@ compdb: clang -MJ $(TTF_DIR)/zlib.json $(COMPDB_CFLAGS) $(ZLIB_SRC) > /dev/null cat $(TTF_DIR)/*.json > $(ERL_TOP)/compile_commands.json -clang_format: +format-check: + clang-format --Werror --dry-run -i beam/jit/*.cpp beam/jit/*.hpp beam/jit/*.c beam/jit/*.h +format: clang-format -i beam/jit/*.cpp beam/jit/*.hpp beam/jit/*.c beam/jit/*.h ifneq ($(ERTS_SKIP_DEPEND),true) diff --git a/make/run_make.mk b/make/run_make.mk index e3e647a499..2c001b7cf9 100644 --- a/make/run_make.mk +++ b/make/run_make.mk @@ -38,5 +38,5 @@ emu jit: $(make_verbose)$(MAKE) -f $(TARGET)/Makefile FLAVOR=$@ clean generate depend docs release release_spec release_docs release_docs_spec \ - tests release_tests release_tests_spec static_lib xmllint clang_format compdb: + tests release_tests release_tests_spec static_lib xmllint format format-check compdb: $(make_verbose)$(MAKE) -f $(TARGET)/Makefile $@ |