Skip to content
Snippets Groups Projects
Unverified Commit be1ac2f2 authored by Luca Weiss's avatar Luca Weiss
Browse files

Add clang-format scripts (MR 3)

parent e8d4c13c
No related branches found
No related tags found
1 merge request!3Add clang-format scripts
Pipeline #144949 passed
#!/bin/sh -e
apk -q add clang
script_dir="$(cd "$(dirname "$0")"; pwd -P)"
"$script_dir"/clang-format.sh
#!/bin/sh
clang-format --version
# shellcheck disable=SC2046
clang-format -i $(find . -regex '.*\.\(c\|cpp\|h\)')
git diff > differences.patch
if [ -s differences.patch ]; then
echo "C-Code formatting check failed!"
echo "Please make sure, the code is formatted properly!"
echo "Run:"
# shellcheck disable=SC2016
echo ' clang-format -i $(find . -regex '\''.*\.\(c\|cpp\|h\)'\'')'
echo
cat differences.patch
echo
rm differences.patch
exit 1
else
echo "C-Code formatting check is sucessful!"
exit 0
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment