From 9c6e7b14a6b3d4bf59dc2b60de1d215281bb4d69 Mon Sep 17 00:00:00 2001 From: jcoupey Date: Wed, 4 Sep 2024 12:09:57 +0200 Subject: [PATCH] Check for clang-format 18. --- CHANGELOG.md | 1 + scripts/format.sh | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46ff37acc..5d7d19195 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/scripts/format.sh b/scripts/format.sh index 1fce4da58..682c44ee1 100755 --- a/scripts/format.sh +++ b/scripts/format.sh @@ -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 @@ -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