forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
26 lines (25 loc) · 1011 Bytes
/
clang-diff-format.yml
File metadata and controls
26 lines (25 loc) · 1011 Bytes
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
name: Clang Diff Format Check
on:
pull_request:
branches:
- develop
jobs:
ClangFormat:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Fetch git
run: git fetch --no-tags -fu origin develop:develop
- name: Run Clang-Format-Diff.py
run: |
git diff -U0 origin/develop -- $(git ls-files -- $(cat test/util/data/non-backported.txt)) | ./contrib/devtools/clang-format-diff.py -p1 > diff_output.txt
if [ -s diff_output.txt ]; then
echo "Clang format differences found:"
cat diff_output.txt
file_count=$(grep -c '^--- .*(before formatting)' diff_output.txt || true)
echo "## ℹ️ Clang Format Style Notes" >> "$GITHUB_STEP_SUMMARY"
echo "Formatting differences found in ${file_count} file(s). See job log for details." >> "$GITHUB_STEP_SUMMARY"
else
echo "No Clang format differences found."
fi