diff --git a/scripts/ci/scripts/run-clang-format.sh b/scripts/ci/scripts/run-clang-format.sh index fd6d351484..c37ab4444d 100755 --- a/scripts/ci/scripts/run-clang-format.sh +++ b/scripts/ci/scripts/run-clang-format.sh @@ -19,9 +19,7 @@ then echo "clang-format:" echo " Code format checks failed." echo " Please run clang-format v16 your changes before committing:" - echo " You can use our CI image for this with:" - echo " docker run -itt --mount type=bind,source=$(pwd),target=/root/adios2 ghcr.io/ornladios/adios2:ci-formatting" - echo " cd /root/adios; scripts/ci/scripts/run-clang-format.sh" + echo " You can use our CI image for this with: scripts/developer/run-clang-format.sh" echo " The following changes are suggested:" echo "${DIFF}" echo "$(git diff --stat)" diff --git a/scripts/developer/run-clang-format.sh b/scripts/developer/run-clang-format.sh new file mode 100755 index 0000000000..fa6c3a5ab2 --- /dev/null +++ b/scripts/developer/run-clang-format.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +exec sudo docker run -itt --mount type=bind,source="$(pwd)",target=/root/adios2 \ + ghcr.io/ornladios/adios2:ci-formatting sh -c \ + "git config --global --add safe.directory /root/adios2 && + cd /root/adios2 && + ./scripts/ci/scripts/run-clang-format.sh"