2018-05-06 13:07:34 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
FIXES_FILE="tidy-fixes.yaml"
|
|
|
|
REGEX="/cuberite/src/\.?[^\.]"
|
2018-08-25 06:25:21 -04:00
|
|
|
ARGS="-header-filter $REGEX -quiet -export-fixes $FIXES_FILE "$@" $REGEX"
|
2018-05-06 13:07:34 -04:00
|
|
|
|
|
|
|
mkdir -p tidy-build
|
|
|
|
cd tidy-build
|
|
|
|
cmake --target Cuberite -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
|
|
|
|
|
2020-05-08 15:18:51 -04:00
|
|
|
if run-clang-tidy $ARGS; then
|
2018-05-06 13:07:34 -04:00
|
|
|
echo "clang-tidy: No violations found"
|
|
|
|
else
|
|
|
|
echo "clang-tidy: Found violations"
|
|
|
|
exit 1
|
|
|
|
fi
|