From 9005eee203fc4b0187290c78f633a70ec6a3c327 Mon Sep 17 00:00:00 2001 From: andregri Date: Tue, 26 Oct 2021 09:36:05 +0200 Subject: [PATCH] Fix cmake clang format (#173) * fix bad directory name of source files * add explicit option for using .clang-format file * fix Clang Tidy CI check --- cmake/clang-format.cmake | 5 +++-- housekeeping/clang-tidy.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmake/clang-format.cmake b/cmake/clang-format.cmake index be90d449..69fa49d3 100644 --- a/cmake/clang-format.cmake +++ b/cmake/clang-format.cmake @@ -1,7 +1,7 @@ file(GLOB_RECURSE ALL_CXX_SOURCE_FILES - core/*.[ch]pp - core/*.[ch] + src/*.[ch]pp + src/*.[ch] test/*.[ch]pp test/*.[ch] ) @@ -16,6 +16,7 @@ if(CLANG_FORMAT_BIN) add_custom_target( clang-format COMMAND "${CLANG_FORMAT_BIN}" + -style=file -i ${ALL_CXX_SOURCE_FILES} ) diff --git a/housekeeping/clang-tidy.sh b/housekeeping/clang-tidy.sh index 1cec62af..c9793ff0 100755 --- a/housekeeping/clang-tidy.sh +++ b/housekeeping/clang-tidy.sh @@ -23,7 +23,7 @@ cd $(dirname $0)/.. FILES=$(get_files) CLANG_TIDY=$(which clang-tidy) -RUN_CLANG_TIDY=$(which run-clang-tidy.py) +RUN_CLANG_TIDY=$(which run-clang-tidy.py) || RUN_CLANG_TIDY=$(which run-clang-tidy) # filter compile_commands.json echo ${FILES} | python3 ./housekeeping/filter_compile_commands.py -p ${BUILD_DIR}