From 98702e482f744c4535ab395eb0a30f0bc1583824 Mon Sep 17 00:00:00 2001 From: Vaclav Petras Date: Wed, 6 Apr 2022 17:23:10 -0400 Subject: [PATCH 1/2] Add clang-tidy This adds clang-tidy to CMake build, but the code needs some fixes first and a special config for test. --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d1652e49..5d9d7ccf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,12 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) # Useful for folders in some IDEs set_property(GLOBAL PROPERTY USE_FOLDERS ON) + set(CMAKE_CXX_CLANG_TIDY + clang-tidy; + -header-filter=include/pops/*.hpp; + -checks=*; + -warnings-as-errors=*;) + # Enables testing for subdirectories and adds target test include(CTest) From 6088e84d4286f56fe9feaeb7863ac8ec574058a2 Mon Sep 17 00:00:00 2001 From: Vaclav Petras Date: Wed, 20 Apr 2022 17:12:50 -0400 Subject: [PATCH 2/2] Add clang-tidy dependency --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 85592804..20790125 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -26,7 +26,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: Install dependencies - run: sudo apt-get install doxygen graphviz + run: sudo apt-get install doxygen graphviz clang-tidy - name: Configure run: | mkdir build && cd build && \