Skip to content

Commit

Permalink
Use clang-format from CI base image
Browse files Browse the repository at this point in the history
  • Loading branch information
SiarheiFedartsou committed Oct 4, 2022
1 parent 2188833 commit fd29934
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/osrm-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ jobs:
- name: Prepare environment
run: |
npm ci --ignore-scripts
export MASON=${GITHUB_WORKSPACE}/scripts/mason.sh
${MASON} install clang-format 10.0.0
echo "$(${MASON} prefix clang-format 10.0.0)/bin" >> $GITHUB_PATH
which clang-format
ls /usr/bin
clang-format-14 --version
- name: Run checks
run: |
./scripts/check_taginfo.py taginfo.json profiles/car.lua
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Thumbs.db
/.vs*
/*.local.bat
/CMakeSettings.json
/.cache

# Jetbrains related files #
###########################
Expand Down
10 changes: 5 additions & 5 deletions scripts/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ elif [[ ${OS} = "Darwin" ]] ; then
fi

# Discover clang-format
if type clang-format-10.0.0 2> /dev/null ; then
CLANG_FORMAT=clang-format-10.0.0
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.0.0, or clang-format)"
echo "No appropriate clang-format found (expected clang-format-14, or clang-format)"
exit 1
fi

Expand Down

0 comments on commit fd29934

Please sign in to comment.