forked from glynos/url
-
Notifications
You must be signed in to change notification settings - Fork 22
32 lines (26 loc) · 923 Bytes
/
clang-format.yml
File metadata and controls
32 lines (26 loc) · 923 Bytes
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
name: clang-format Check
on: [push, pull_request]
jobs:
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install clang-format
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 21
sudo apt-get install -y clang-format-21
- name: Run clang-format
run: |
find include tests -name '*.hpp' -o -name '*.cpp' | xargs clang-format-21 --dry-run --Werror
- name: Formatting check passed
if: success()
run: echo "✓ All files are properly formatted"
- name: Formatting check failed
if: failure()
run: |
echo "✗ Some files need formatting. Run 'clang-format -i <files>' to fix."
echo "Or run: find include tests -name '*.hpp' -o -name '*.cpp' | xargs clang-format -i"
exit 1