12.8.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 99efd44f authored by Jens Petit's avatar Jens Petit
Browse files

Fix clang-format script (#53)

parent 545fca49
Pipeline #224033 passed with stages
in 33 minutes and 7 seconds
......@@ -9,12 +9,19 @@ if [ ! -z "$(git status --untracked-files=no --porcelain)" ]; then
echo "Checking formatting using the following clang-format version:"
clang-format --version
if type clang-format-8 2>/dev/null; then
echo "Checking formatting using the following clang-format version:"
clang-format-8 --version
echo "clang-format-8 not correctly installed"
exit 1
# perform clang-format on all cpp-files
find elsa/ -name '*.h' -or -name '*.hpp' -or -name '*.cpp' -or -name '*.cu' -or -name '*.cuh' | xargs clang-format -i -style=file $1
find elsa/ -name '*.h' -or -name '*.hpp' -or -name '*.cpp' -or -name '*.cu' -or -name '*.cuh' | xargs clang-format-8 -i -style=file $1
# check if something was modified
notcorrectlist=`git status --porcelain | grep '^ M' | cut -c4-`
......@@ -28,7 +35,7 @@ else
git diff --stat $notcorrectlist
echo "Please run"
echo "find elsa/ -name '*.h' -or -name '*.hpp' -or -name '*.cpp' -or -name '*.cu' -or -name '*.cuh' | xargs clang-format -i -style=file $1"
echo "find elsa/ -name '*.h' -or -name '*.hpp' -or -name '*.cpp' -or -name '*.cu' -or -name '*.cuh' | xargs clang-format-8 -i -style=file $1"
echo "to solve the issue."
# cleanup changes in git
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment