Upgrade clang-format to version 14

Version 14 is the version available on ubuntu-latest in Github actions
This commit is contained in:
Dennis Luxen 2024-05-05 21:10:59 +02:00
parent befd9dc5ae
commit 81a00a636f
3 changed files with 8 additions and 8 deletions

View File

@ -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

View File

@ -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`
```

View File

@ -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