Skip to content

Commit 54a2e32

Browse files
authored
[infra] Simplify clang-tidy usage (#379)
* Simplify clang-tidy usage Signed-off-by: Uilian Ries <[email protected]> * Use run-clang-tidy Signed-off-by: Uilian Ries <[email protected]> * Ignore errors related to llvm-header-guard Signed-off-by: Uilian Ries <[email protected]> * Split execution again Signed-off-by: Uilian Ries <[email protected]> * Ignore false-positive from clang-tidy Signed-off-by: Uilian Ries <[email protected]> * Revert read_file_stdio.hpp Signed-off-by: Uilian Ries <[email protected]> * Clang tidy is optional! Signed-off-by: Uilian Ries <[email protected]> --------- Signed-off-by: Uilian Ries <[email protected]>
1 parent 0d37dcf commit 54a2e32

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Checks: >-
3535
-readability-identifier-length,
3636
-readability-magic-numbers,
3737
-readability-static-accessed-through-instance,
38+
-llvm-header-guard,
3839
3940
CheckOptions:
4041
- { key: readability-identifier-naming.ClassCase, value: lower_case }

.github/workflows/clang-tidy.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,20 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919

20-
- run: sudo apt-get update -yq
20+
- name: Install Dependencies
21+
run: |
22+
sudo apt-get -qq update -yq
23+
sudo apt-get -qq install -y clang-tidy --no-install-recommends --no-install-suggests
2124
22-
- run: sudo apt-get install -yq clang-tidy
25+
- name: Generate Compilation Database
26+
run: cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
2327

24-
- 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
28+
- name: Run clang-tidy on Header Files
29+
continue-on-error: true
30+
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
2531

26-
- run: find src/ -name '*.cpp' | xargs -I '{}' clang-tidy --quiet '{}' -- --std=c++17 -Iinclude
32+
- name: Run clang-tidy on tests and examples files
33+
continue-on-error: true
34+
run: find src/ -type f -name "*.cpp" | xargs -P $(nproc) -I {} clang-tidy -quiet -p build {} -- -std=c++17 -Iinclude

0 commit comments

Comments
 (0)