-
-
Notifications
You must be signed in to change notification settings - Fork 264
30 lines (29 loc) · 1010 Bytes
/
check-format.yaml
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
name: Check Format
on: [push, pull_request]
jobs:
run_clangformat:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: DoozyX/clang-format-lint-action@v0.18.2
with:
source: './Source ./tools'
exclude: './Source/ui_qt/win32/Resources ./Source/ui_libretro/ext'
extensions: 'h,cpp,c,m,mm'
clangFormatVersion: 16
inplace: True
- name: Check for changes
run: |
set +e
git config --global user.name "Clang-Format"
git config --global user.email "Clang-Format"
git commit -am"Clang-format";
if [ $? -eq 0 ]; then
url=$(git format-patch -1 HEAD --stdout | nc termbin.com 9999)
echo "generated clang-format patch can be found at: $url"
echo "you can pipe patch directly using the following command:";
echo "curl $url | git apply -v"
echo "then manually commit and push the changes"
exit -1;
fi
exit 0;