From 150ca0f77bdebc1be0269e80dfcf7e37372de289 Mon Sep 17 00:00:00 2001 From: liuyuecai Date: Sat, 16 Nov 2024 17:20:49 +0800 Subject: [PATCH] add "make fix-format" command to format code automatically --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f57a728..eccbbdd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -219,6 +219,13 @@ ADD_CUSTOM_TARGET(check-format --source_dirs ${FORMAT_DIRS} ) +ADD_CUSTOM_TARGET(fix-format + COMMAND ${BUILD_SUPPORT_DIR}/run_clang_format.py + ${CLANG_FORMAT_BIN} + ${BUILD_SUPPORT_DIR}/clang_format_exclusions.txt + --source_dirs ${FORMAT_DIRS} --fix +) + ADD_CUSTOM_TARGET(clang-tidy COMMAND ${BUILD_SUPPORT_DIR}/run_clang_tidy.py -clang-tidy-binary ${CLANG_TIDY_BIN}