mirror of
https://github.com/jpd002/Play-.git
synced 2025-04-28 13:47:57 +03:00
30 lines
1,010 B
YAML
30 lines
1,010 B
YAML
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.16.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;
|