From 8e23d2b96fb7aace623e72078265cbed896cd0c2 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 7 Oct 2019 06:33:32 -0700 Subject: [PATCH 1/2] fix: clang-tidy --- CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d8f70caa..6f0cf6fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,8 +36,8 @@ execute_process( if(ENABLE_CLANG_TIDY) - find_program(CLANG_TIDY_BIN clang-tidy-6.0) - find_program(RUN_CLANG_TIDY_BIN run-clang-tidy-6.0.py) + find_program(CLANG_TIDY_BIN clang-tidy-5.0) + find_program(RUN_CLANG_TIDY_BIN run-clang-tidy-5.0.py) if(CLANG_TIDY_BIN STREQUAL "CLANG_TIDY_BIN-NOTFOUND") message(FATAL_ERROR "unable to locate clang-tidy-5.0") @@ -49,7 +49,6 @@ if(ENABLE_CLANG_TIDY) list(APPEND RUN_CLANG_TIDY_BIN_ARGS -clang-tidy-binary ${CLANG_TIDY_BIN} - "\"-header-filter=.*\\b(src|test|examples)\\b\\/(?!lib).*\"" #Only run clang tidy on src, test, examples and skip 3rd party libraries -checks=clan*,cert*,misc*,perf*,cppc*,read*,mode*,-cert-err58-cpp,-misc-noexcept-move-constructor,-cppcoreguidelines-* ) From aa5eca03d5169f6910a7e5fc01d9e53573028b34 Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 8 Oct 2019 14:01:09 -0700 Subject: [PATCH 2/2] fix: pass clang tidy --- .github/workflows/test/clang_tidy.sh | 2 +- CMakeLists.txt | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test/clang_tidy.sh b/.github/workflows/test/clang_tidy.sh index 832423db..8508d2dc 100644 --- a/.github/workflows/test/clang_tidy.sh +++ b/.github/workflows/test/clang_tidy.sh @@ -1,7 +1,7 @@ #!/bin/bash # run clang tidy -cmake -DENABLE_CLANG_TIDY=ON . +cmake -DENABLE_CLANG_TIDY=ON -DUNIT_TEST=ON . make tidy > output.txt #if [[ -n $(grep "warning: " output.txt) ]] || [[ -n $(grep "error: " output.txt) ]]; then # for now only fail the test on errors. Change this as project matures diff --git a/CMakeLists.txt b/CMakeLists.txt index b346d59e..dc18b910 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,9 +45,10 @@ if(ENABLE_CLANG_TIDY) message(FATAL_ERROR "unable to locate run-clang-tidy-5.0.py") endif() - list(APPEND RUN_CLANG_TIDY_BIN_ARGS - -clang-tidy-binary ${CLANG_TIDY_BIN} - -checks=clan*,cert*,misc*,perf*,cppc*,read*,mode*,-cert-err58-cpp,-misc-noexcept-move-constructor,-cppcoreguidelines-*) + list(APPEND RUN_CLANG_TIDY_BIN_ARGS + -clang-tidy-binary ${CLANG_TIDY_BIN} + -header-filter="\".*\\b(cpp-client/src)\"" + -checks=clan*,cert*,misc*,perf*,cppc*,read*,mode*,-cert-err58-cpp,-misc-noexcept-move-constructor,-cppcoreguidelines-*) add_custom_target(tidy COMMAND ${RUN_CLANG_TIDY_BIN} ${RUN_CLANG_TIDY_BIN_ARGS}