Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump clang-format to clang-15 #8561

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pull-request-check-clang-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -e
echo "Pull request's base branch is: ${BASE_BRANCH}"
echo "Pull request's merge branch is: ${MERGE_BRANCH}"
echo "Pull request's source branch is: ${GITHUB_HEAD_REF}"
clang-format-11 --version
clang-format-15 --version

# The checkout action leaves us in detatched head state. The following line
# names the checked out commit, for simpler reference later.
Expand All @@ -26,7 +26,7 @@ echo "Checking for formatting errors introduced since $MERGE_BASE"

# Do the checking. "eval" is used so that quotes (as inserted into $EXCLUDES
# above) are not interpreted as parts of file names.
eval git-clang-format-11 --binary clang-format-11 $MERGE_BASE -- $EXCLUDES
eval git-clang-format-15 --binary clang-format-15 $MERGE_BASE -- $EXCLUDES
git diff > formatted.diff
if [[ -s formatted.diff ]] ; then
echo 'Formatting error! The following diff shows the required changes'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/syntax-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
# This job takes approximately 1 minute
check-clang-format:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -19,8 +19,8 @@ jobs:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -yq clang-format-11
- name: Check updated lines of code match clang-format-11 style
sudo apt-get install --no-install-recommends -yq clang-format-15
- name: Check updated lines of code match clang-format-15 style
env:
BASE_BRANCH: ${{ github.base_ref }}
MERGE_BRANCH: ${{ github.ref }}
Expand Down
11 changes: 5 additions & 6 deletions CODING_STANDARD.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,13 +341,12 @@ To avoid waiting until you've made a PR to find formatting issues, you can
install clang-format locally and run it against your code as you are working.

Different versions of clang-format have slightly different behaviors. CBMC uses
clang-format-11 as it is available the repositories for Ubuntu 20.04 and
Homebrew.
To install on a Unix-like system, try installing using the system package
manager:
clang-format-15, available in the standard Ubuntu 24.04 and Homebrew
repositories. To install on a Unix-like system, try installing using the
system package manager:
```
apt-get install clang-format-11 # Run this on Ubuntu, Debian etc.
brew install clang-format@11 # Run this on a Mac with Homebrew installed
apt-get install clang-format-15 # Run this on Ubuntu, Debian etc.
brew install clang-format # Run this on a Mac with Homebrew installed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not an expert on brew, but this seems like it will break in future when the default is upgraded (where as all the other places and previous code are explicit about the version).

```

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