mirror of
https://github.com/qicosmos/rest_rpc.git
synced 2026-08-29 08:34:47 +08:00
26 lines
671 B
YAML
26 lines
671 B
YAML
name: Clang Format Diff
|
|
|
|
on: [ push, pull_request ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: install clang-format
|
|
run: sudo apt install clang-format
|
|
|
|
- name: check-diff
|
|
run: |
|
|
diff=`git-clang-format --diff HEAD^`
|
|
if ! [[ "$diff" = "no modified files to format" || "$diff" = "clang-format did not modify any files" ]]; then
|
|
echo "The diff you sent is not formatted correctly."
|
|
echo "The suggested format is"
|
|
echo "$diff"
|
|
exit 1
|
|
fi |