diff --git a/.clang-tidy b/.clang-tidy index b4ec5b208..e6f6ee838 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -35,6 +35,7 @@ Checks: >- -readability-identifier-length, -readability-magic-numbers, -readability-static-accessed-through-instance, + -llvm-header-guard, CheckOptions: - { key: readability-identifier-naming.ClassCase, value: lower_case } diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index d095bce35..4dd14c6f1 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -15,12 +15,20 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - run: sudo apt-get update -yq + - name: Install Dependencies + run: | + sudo apt-get -qq update -yq + sudo apt-get -qq install -y clang-tidy --no-install-recommends --no-install-suggests - - run: sudo apt-get install -yq clang-tidy + - name: Generate Compilation Database + run: cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - - run: find include/ -name '*.hpp' | grep -vF mmap_file_win32.hpp | grep -vF endian_win.hpp | xargs -I '{}' clang-tidy --quiet '{}' -- --std=c++17 -Iinclude + - name: Run clang-tidy on Header Files + continue-on-error: true + run: find include/ -type f \( -name "*.hpp" -a ! -name "endian_win.hpp" -a ! -name "mmap_file_win32.hpp" \) | xargs -P $(nproc) -I {} clang-tidy -quiet -p build {} -- -std=c++17 -Iinclude - - run: find src/ -name '*.cpp' | xargs -I '{}' clang-tidy --quiet '{}' -- --std=c++17 -Iinclude + - name: Run clang-tidy on tests and examples files + continue-on-error: true + run: find src/ -type f -name "*.cpp" | xargs -P $(nproc) -I {} clang-tidy -quiet -p build {} -- -std=c++17 -Iinclude