mirror of
https://github.com/minetest/minetest.git
synced 2024-12-13 01:43:17 +01:00
077f231111
* Promote performance-type-promotion-in-math-fn as a coding error * Promote performance-faster-string-find too (which is not problematic currently) * Same for performance-implicit-cast-in-loop * Fix remaining tidy points
28 lines
836 B
Bash
Executable File
28 lines
836 B
Bash
Executable File
if hash clang-tidy-5.0 2>/dev/null; then
|
|
CLANG_TIDY=clang-tidy-5.0
|
|
else
|
|
CLANG_TIDY=clang-tidy
|
|
fi
|
|
|
|
files_to_analyze="$(find src/ -name '*.cpp' -or -name '*.h')"
|
|
|
|
mkdir -p cmakebuild && cd cmakebuild
|
|
cmake -DCMAKE_BUILD_TYPE=Debug \
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
|
-DRUN_IN_PLACE=TRUE \
|
|
-DENABLE_GETTEXT=TRUE \
|
|
-DENABLE_SOUND=FALSE \
|
|
-DBUILD_SERVER=TRUE ..
|
|
make GenerateVersion
|
|
cd ..
|
|
|
|
echo "Performing clang-tidy checks..."
|
|
./util/travis/run-clang-tidy.py -clang-tidy-binary=${CLANG_TIDY} -p cmakebuild \
|
|
-checks='-*,modernize-use-emplace,modernize-avoid-bind,performance-*' \
|
|
-warningsaserrors='-*,modernize-use-emplace,performance-type-promotion-in-math-fn,performance-faster-string-find,performance-implicit-cast-in-loop' \
|
|
-no-command-on-stdout -quiet \
|
|
files 'src/.*'
|
|
RET=$?
|
|
echo "Clang tidy returned $RET"
|
|
exit $RET
|