Skip to content

Commit

Permalink
Update to clang-format 15
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jan 24, 2023
1 parent 2356d9a commit fa7574c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v10.0.1'
rev: 'v15.0.4'
hooks:
- id: clang-format
exclude: >
Expand Down
5 changes: 0 additions & 5 deletions scripts/proj_clang_format/Dockerfile

This file was deleted.

8 changes: 4 additions & 4 deletions scripts/reformat_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ esac

TOPDIR="$(readlink -f $SCRIPT_DIR/..)"

if ! (clang-format --version 2>/dev/null | grep 10 >/dev/null); then
echo "clang-format 10 not available. Running it from a Docker image";
docker build -t proj_clang_format -f "$TOPDIR"/scripts/proj_clang_format/Dockerfile "$TOPDIR"/scripts/proj_clang_format
if ! (clang-format --version 2>/dev/null | grep 15 >/dev/null); then
echo "clang-format 15 not available. Running it from a Docker image";
docker pull silkeh/clang:15-bullseye
UID=$(id -u "${USER}")
GID=$(id -g "${USER}")
exec docker run --rm -u "$UID:$GID" -v "$TOPDIR":"$TOPDIR" proj_clang_format "$TOPDIR"/scripts/reformat_cpp.sh
exec docker run --rm -u "$UID:$GID" -v "$TOPDIR":"$TOPDIR" silkeh/clang:15-bullseye "$TOPDIR"/scripts/reformat_cpp.sh
fi

for i in `find "$TOPDIR" -name "*.h" -o -name "*.hpp" -o -name "*.cpp" -o -name "*.c"`; do
Expand Down

0 comments on commit fa7574c

Please sign in to comment.