We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0b16ca commit 67f0dffCopy full SHA for 67f0dff
1 file changed
.github/workflows/format.yml
@@ -0,0 +1,29 @@
1
+---
2
+
3
+name: Check for correct formatting
4
5
+on:
6
+ push:
7
+ branches: [main]
8
+ pull_request:
9
10
11
+jobs:
12
+ check_formatting:
13
+ runs-on: ubuntu-latest
14
+ container:
15
+ image: archlinux:latest
16
+ steps:
17
+ - uses: actions/checkout@v2
18
+ - name: Install dependencies
19
+ run: pacman --noconfirm -Syu findutils git clang
20
+ - name: Run clang-format on all C and C++ sources
21
+ run: |
22
+ find . -type f -iname "*.c" -or -iname "*.cc" -or -iname "*.cpp" -or -iname "*.h"
23
+ find . -type f -iname "*.c" -or -iname "*.cc" -or -iname "*.cpp" -or -iname "*.h" -exec clang-format -i {} \;
24
+ - name: Check whether there are differences
25
26
+ if [[ -z "$(git status -s)" ]]; then
27
+ printf "Files are not properly formatted!\n"
28
+ git diff
29
+ fi
0 commit comments