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

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 ...@@ -9,12 +9,19 @@ if [ ! -z "$(git status --untracked-files=no --porcelain)" ]; then
fi fi
echo echo
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
else
echo "clang-format-8 not correctly installed"
exit 1
fi
echo echo
# perform clang-format on all cpp-files # 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 # check if something was modified
notcorrectlist=`git status --porcelain | grep '^ M' | cut -c4-` notcorrectlist=`git status --porcelain | grep '^ M' | cut -c4-`
...@@ -28,7 +35,7 @@ else ...@@ -28,7 +35,7 @@ else
git diff --stat $notcorrectlist git diff --stat $notcorrectlist
echo "Please run" echo "Please run"
echo echo
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 echo
echo "to solve the issue." echo "to solve the issue."
# cleanup changes in git # 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