Skip to content

Commit

Permalink
Upgrade format checker CI to clang-format-18
Browse files Browse the repository at this point in the history
  • Loading branch information
abhaybd committed Dec 9, 2023
1 parent 97d592f commit 316754d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/format-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ jobs:
submodules: true
- name: Install dependencies from APT
run: |
sudo apt install -y git clang-format-11
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-11 100 \
--slave /usr/share/man/man1/clang-format.1.gz clang-format.1.gz /usr/share/man/man1/clang-format-11.1.gz
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18
sudo apt install -y git clang-format-18
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-18 100
- name: Check Formatting
run: |
cd ${{ github.workspace }}
git reset --soft $(git merge-base HEAD origin/master)
diff=$(git clang-format-11 --diff)
diff=$(git clang-format-18 --style=file --diff)
if [ $(echo "${diff}" | wc -l) != 1 ]; then
echo "Formatting errors detected! Suggested changes:" >&2
echo "${diff}" >&2
Expand Down

0 comments on commit 316754d

Please sign in to comment.