Skip to content

Commit

Permalink
Merge branch 'enhancement/clang-format-18'
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoupey committed Sep 4, 2024
2 parents bc29414 + 9c6e7b1 commit 74e6be7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Update Ubuntu image to 24.04 (#1080)
- `vroom` workflow uses g++-14 and clang++-18 (#1080)
- `vroom + libosrm` workflow uses g++-13 and clang++-17 (#1080)
- Update clang-format to 18 (#1148)

### Fixed

Expand Down
12 changes: 6 additions & 6 deletions scripts/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -o nounset

# Runs the Clang Formatter in parallel on the code base.
# Return codes:
# - 1 there are files to be formatted or clang-format 6.0 is missing
# - 1 there are files to be formatted or clang-format 18 is missing
# - 0 everything looks fine

# Get CPU count
Expand All @@ -22,18 +22,18 @@ elif [[ ${OS} = "Darwin" ]] ; then
fi

# Discover clang-format
if type clang-format-15 2> /dev/null ; then
CLANG_FORMAT=clang-format-15
if type clang-format-18 2> /dev/null ; then
CLANG_FORMAT=clang-format-18
elif type clang-format 2> /dev/null ; then
# Clang format found, but need to check version
CLANG_FORMAT=clang-format
V=$(clang-format --version)
if [[ $V != *15.0* ]] ; then
echo "clang-format is not 15.0 (returned ${V})"
if [[ $V != *18* ]] ; then
echo "clang-format is not 18 (returned ${V})"
exit 1
fi
else
echo "No appropriate clang-format found (expected clang-format-15, or clang-format)"
echo "No appropriate clang-format found (expected clang-format-18, or clang-format)"
exit 1
fi

Expand Down

0 comments on commit 74e6be7

Please sign in to comment.