Skip to content

Commit 6d6319f

Browse files
committed
Use Ubuntu-provided git-clang-format in CI check
The 14.0.6 version of git-clang-format (which was introduced in b377779) appears to be incompatible with clang-format-11. The result was that context lines of the diff got formatted as well, as seen in https://github.com/diffblue/cbmc/actions/runs/3141827465/jobs/5104706348. Using the distribution-provided version of git-clang-format fixes this problem.
1 parent 8b5d37a commit 6d6319f

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

.github/workflows/pull-request-check-clang-format.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ echo "Checking for formatting errors introduced since $MERGE_BASE"
2626

2727
# Do the checking. "eval" is used so that quotes (as inserted into $EXCLUDES
2828
# above) are not interpreted as parts of file names.
29-
eval git-clang-format --binary clang-format-11 $MERGE_BASE -- $EXCLUDES
29+
eval git-clang-format-11 --binary clang-format-11 $MERGE_BASE -- $EXCLUDES
3030
git diff > formatted.diff
3131
if [[ -s formatted.diff ]] ; then
3232
echo 'Formatting error! The following diff shows the required changes'

.github/workflows/pull-request-checks.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,6 @@ jobs:
612612
run: |
613613
sudo apt-get update
614614
sudo apt-get install --no-install-recommends -yq clang-format-11
615-
wget -O git-clang-format https://raw.githubusercontent.com/llvm/llvm-project/llvmorg-14.0.6/clang/tools/clang-format/git-clang-format
616-
chmod u+x git-clang-format
617-
mv git-clang-format /usr/local/bin
618615
- name: Check updated lines of code match clang-format-11 style
619616
env:
620617
BASE_BRANCH: ${{ github.base_ref }}

0 commit comments

Comments
 (0)