Skip to content
Snippets Groups Projects
Unverified Commit 90e2cc7e authored by Luca Weiss's avatar Luca Weiss Committed by Oliver Smith
Browse files

CI: check coding style of C code (!465)

parent 4553bd70
Branches
No related tags found
No related merge requests found
......@@ -42,6 +42,15 @@ py-sh-static:
script:
- .gitlab-ci/static_code_analysis.sh
# coding style check
clang-format-static:
stage: first
<<: *only-default
before_script:
- apk -q add clang git
script:
- .gitlab-ci/static_clang-format.sh
# aports checks (generic)
aports-static:
stage: first
......
#!/bin/sh
set -e
clang-format -i $(find . -name "*.c")
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:"
echo ' clang-format -i $(find . -name "*.c")'
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