Skip to content

Commit

Permalink
[skip-ci] Update clang-format check
Browse files Browse the repository at this point in the history
Signed-off-by: Geoff Hutchison <[email protected]>
  • Loading branch information
ghutchis committed Dec 30, 2024
1 parent 4d12b05 commit bd8ef2e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
if: ${{ github.ref != 'refs/heads/master' }}
steps:
- name: 'Install clang-format'
run: sudo apt-get -qq install clang-format-15
run: sudo apt-get -qq install clang-format-16

- uses: actions/checkout@v4

Expand All @@ -17,17 +17,16 @@ jobs:
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/openchemistry/avogadrolibs
git fetch origin master:master
echo `which clang-format-diff-13`
export MASTER_SHA=`cat .git/refs/heads/master`
echo MASTER_SHA=${MASTER_SHA}
git diff `cat .git/refs/heads/master` --name-only
DIFF=`git diff -U0 ${MASTER_SHA} -- '*.h' '*.cpp' | clang-format-diff-13 -p1`
DIFF=`git diff -U0 ${MASTER_SHA} -- '*.h' '*.cpp' | clang-format-diff-16 -p1`
if [ -z "$DIFF" ]; then
printf "clang-format-diff reports no problems"
exit 0
else
git diff -U0 ${MASTER_SHA} -- '*.h' '*.cpp' | clang-format-diff-13 -p1 >${{ runner.workspace }}/clang-format.diff
git diff -U0 ${MASTER_SHA} -- '*.h' '*.cpp' | clang-format-diff-16 -p1 >${{ runner.workspace }}/clang-format.diff
exit 1
fi
Expand Down

0 comments on commit bd8ef2e

Please sign in to comment.