Use clang-format from CI base image

This commit is contained in:
Siarhei Fedartsou 2022-10-04 18:03:04 +02:00
parent 43efd0767f
commit 8d1da94e28
2 changed files with 6 additions and 6 deletions

View File

@ -88,7 +88,7 @@ jobs:
- name: Prepare environment
run: |
npm ci --ignore-scripts
clang-format-11 --version
clang-format-10 --version
- name: Run checks
run: |
./scripts/check_taginfo.py taginfo.json profiles/car.lua

View File

@ -19,18 +19,18 @@ elif [[ ${OS} = "Darwin" ]] ; then
fi
# Discover clang-format
if type clang-format-11 2> /dev/null ; then
CLANG_FORMAT=clang-format-11
if type clang-format-10 2> /dev/null ; then
CLANG_FORMAT=clang-format-10
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 != *11.0* ]] ; then
echo "clang-format is not 11.0 (returned ${V})"
if [[ $V != *10.0* ]] ; then
echo "clang-format is not 10.0 (returned ${V})"
#exit 1
fi
else
echo "No appropriate clang-format found (expected clang-format-11, or clang-format)"
echo "No appropriate clang-format found (expected clang-format-10, or clang-format)"
exit 1
fi