-
Notifications
You must be signed in to change notification settings - Fork 226
39 lines (32 loc) · 1.26 KB
/
clang-tidy.yml
File metadata and controls
39 lines (32 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Clang Tidy Include Cleaner
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
jobs:
clang-tidy-include-cleaner:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0 # Fetch all history for git diff
token: ${{ secrets.GITHUB_TOKEN }} # Use GITHUB_TOKEN for pushing changes
- name: Install Clang-Tidy
run: |
sudo apt-get update
sudo apt-get install -y clang-tools-19
- name: Run Clang-Tidy Include Cleaner
run: |
echo "Running clang-tidy on .hpp files"
git diff --diff-filter=d --name-only origin/main | grep -E "\.hpp$" | xargs -r -t -n 1 -P 8 -- /usr/bin/clang-tidy-19 --fix --checks="-*,misc-include-cleaner" || true
echo "Running clang-tidy on .cpp files"
git diff --diff-filter=d --name-only origin/main | grep -E "\.cpp$" | xargs -r -t -n 1 -P 8 -- /usr/bin/clang-tidy-19 --fix --checks="-*,misc-include-cleaner" || true
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
author_name: Clang Tidy Bot
author_email: actions@github.com
message: 'Apply clang-tidy include cleaner fixes'
add: '*.hpp *.cpp' # Add only the changed C++ files