File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+
3+ name : Check for correct formatting
4+
5+ on :
6+ push :
7+ branches : [main]
8+ pull_request :
9+ branches : [main]
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+ run : |
26+ if [[ -z "$(git status -s)" ]]; then
27+ printf "Files are not properly formatted!\n"
28+ git diff
29+ fi
You can’t perform that action at this time.
0 commit comments