File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed
Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ # ignore third_party code from clang-format checks
2+ third_party/*
3+ test/third_party/*
4+ system/lib/libc/musl
5+ system/lib/libcxx
6+ system/lib/libcxxabi
7+ system/lib/libunwind
8+ system/lib/mimalloc
9+ system/lib/llvm-libc
Original file line number Diff line number Diff line change 9898 echo "-- This failure is only a warning and can be ignored"
9999 exit 1
100100 fi
101+
102+ clang-format-diff :
103+ env :
104+ LLVM_VERSION : 19
105+ runs-on : ubuntu-latest
106+ steps :
107+ - uses : actions/checkout@v4
108+ # Fetch all history for all tags and branches
109+ with :
110+ fetch-depth : 0
111+ - name : Install clang-format
112+ run : |
113+ sudo apt-get install clang-format-19
114+ sudo update-alternatives --install /usr/bin/git-clang-format git-clang-format /usr/bin/git-clang-format-19 100
115+ - run : tools/maint/clang-format-diff.sh origin/$GITHUB_BASE_REF
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Based on binaryen/scripts/clang-format-diff.sh
3+ # TODO(sbc): Switch to pre-packaged github actions once we find one that
4+ # is mature enough for our needs.
5+
6+ set -o errexit
7+ set -o pipefail
8+ set -o xtrace
9+
10+ if [ -n " $1 " ]; then
11+ BRANCH=" $1 "
12+ else
13+ BRANCH=" @{upstream}"
14+ fi
15+
16+ MERGE_BASE=$( git merge-base $BRANCH HEAD)
17+ FORMAT_ARGS=${MERGE_BASE}
18+ if [ -n " $LLVM_VERSION " ]; then
19+ FORMAT_ARGS=" --binary=clang-format-${LLVM_VERSION} ${FORMAT_ARGS} "
20+ fi
21+
22+ git clang-format ${FORMAT_ARGS} --diff
You can’t perform that action at this time.
0 commit comments