Skip to content

[infra] Simplify clang-tidy usage #379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading