Skip to content

Commit 08d558d

Browse files
committed
bump clang-format to clang-15
clang 11 was released in 2007, and the last variant of Ubuntu with the clang-format-11 package is 22.04. This bumps the clang-format used for the formatting check to clang 15, available with Ubuntu 22.04 and 24.04.
1 parent 6957a04 commit 08d558d

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

Diff for: .github/workflows/pull-request-check-clang-format.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -e
77
echo "Pull request's base branch is: ${BASE_BRANCH}"
88
echo "Pull request's merge branch is: ${MERGE_BRANCH}"
99
echo "Pull request's source branch is: ${GITHUB_HEAD_REF}"
10-
clang-format-11 --version
10+
clang-format-15 --version
1111

1212
# The checkout action leaves us in detatched head state. The following line
1313
# names the checked out commit, for simpler reference later.
@@ -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-11 --binary clang-format-11 $MERGE_BASE -- $EXCLUDES
29+
eval git-clang-format-15 --binary clang-format-15 $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'

Diff for: .github/workflows/syntax-checks.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
# This job takes approximately 1 minute
88
check-clang-format:
9-
runs-on: ubuntu-20.04
9+
runs-on: ubuntu-24.04
1010
steps:
1111
- uses: actions/checkout@v4
1212
with:
@@ -19,8 +19,8 @@ jobs:
1919
DEBIAN_FRONTEND: noninteractive
2020
run: |
2121
sudo apt-get update
22-
sudo apt-get install --no-install-recommends -yq clang-format-11
23-
- name: Check updated lines of code match clang-format-11 style
22+
sudo apt-get install --no-install-recommends -yq clang-format-15
23+
- name: Check updated lines of code match clang-format-15 style
2424
env:
2525
BASE_BRANCH: ${{ github.base_ref }}
2626
MERGE_BRANCH: ${{ github.ref }}

Diff for: CODING_STANDARD.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -340,14 +340,13 @@ Now, you can commit and push the formatting fixes.
340340
To avoid waiting until you've made a PR to find formatting issues, you can
341341
install clang-format locally and run it against your code as you are working.
342342

343-
Different versions of clang-format have slightly different behaviors. CBMC uses
344-
clang-format-11 as it is available the repositories for Ubuntu 20.04 and
345-
Homebrew.
346-
To install on a Unix-like system, try installing using the system package
347-
manager:
343+
Different versions of clang-format have slightly different behaviors. CBMC
344+
uses clang-format-15, or later, available in the standard Ubuntu 24.04 and
345+
Homebrew repositories. To install on a Unix-like system, try installing
346+
using the system package manager:
348347
```
349-
apt-get install clang-format-11 # Run this on Ubuntu, Debian etc.
350-
brew install clang-format@11 # Run this on a Mac with Homebrew installed
348+
apt-get install clang-format # Run this on Ubuntu, Debian etc.
349+
brew install clang-format # Run this on a Mac with Homebrew installed
351350
```
352351

353352
If your platform doesn't have a package for clang-format, you can download a

0 commit comments

Comments
 (0)