From 81a00a636f09bf6ca9e1e76811031b7dba284034 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Sun, 5 May 2024 21:10:59 +0200 Subject: [PATCH] Upgrade clang-format to version 14 Version 14 is the version available on ubuntu-latest in Github actions --- .github/workflows/osrm-backend.yml | 4 ++-- CONTRIBUTING.md | 2 +- scripts/format.sh | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 6e8be0645..d1a14d8a9 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -71,7 +71,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} format-taginfo-docs: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - name: Use Node.js @@ -88,7 +88,7 @@ jobs: - name: Prepare environment run: | npm ci --ignore-scripts - clang-format-10 --version + clang-format-14 --version - name: Run checks run: | ./scripts/check_taginfo.py taginfo.json profiles/car.lua diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 30b697e55..2b36d2b6c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ You can add a :+1: emoji reaction to the issue if you want to express interest i # Developer -We use `clang-format` version `3.8` to consistently format the code base. There is a helper script under `scripts/format.sh`. +We use `clang-format` version `14` to consistently format the code base. There is a helper script under `scripts/format.sh`. The format is automatically checked by the `mason-linux-release` job of a Travis CI build. To save development time a local hook `.git/hooks/pre-push` ``` diff --git a/scripts/format.sh b/scripts/format.sh index 03ffcaba1..1a256d27e 100755 --- a/scripts/format.sh +++ b/scripts/format.sh @@ -19,18 +19,18 @@ elif [[ ${OS} = "Darwin" ]] ; then fi # Discover clang-format -if type clang-format-10 2> /dev/null ; then - CLANG_FORMAT=clang-format-10 +if type clang-format-14 2> /dev/null ; then + CLANG_FORMAT=clang-format-14 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 != *10.0* ]] ; then - echo "clang-format is not 10.0 (returned ${V})" + if [[ $V != *14.0* ]] ; then + echo "clang-format is not 14.0 (returned ${V})" #exit 1 fi else - echo "No appropriate clang-format found (expected clang-format-10, or clang-format)" + echo "No appropriate clang-format found (expected clang-format-14, or clang-format)" exit 1 fi