summaryrefslogblamecommitdiffstats
path: root/clang-tidy.sh
blob: 86a71521b8f4a7bc334245aeee22f269270e5bf3 (plain) (tree)
1
2
3
4
5
6
7
8
9





                              
                                                                         
 
                                   



                                                             


                                                 
                             




                                              
#!/bin/sh

set -e

FIXES_FILE="tidy-fixes.yaml"
REGEX="/cuberite/src/\.?[^\.]"
ARGS="-header-filter $REGEX -quiet -export-fixes $FIXES_FILE "$@" $REGEX"

# Generate the compilation database
mkdir -p tidy-build
cd tidy-build
cmake --target Cuberite -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..

# Ensure LuaState_Typedefs.inc has been generated
(cd ../src/Bindings && lua BindingsProcessor.lua)

if run-clang-tidy $ARGS; then
	echo "clang-tidy: No violations found"
else
	echo "clang-tidy: Found violations"
	exit 1
fi