62e95745ac
* Add Jenkinsfile * cd src * Escape wildcards * Refactor stages * Remove CircleCI junk * Make clang-tidy do something * updated regex to include only the files in the base src directory * fixed errors displayed by new clang tidy version * adjust clang core count to actual count * Update README with new Jenkins build Co-authored-by: 12xx12 <44411062+12xx12@users.noreply.github.com>
26 lines
753 B
Bash
Executable File
26 lines
753 B
Bash
Executable File
#!/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
|
|
|
|
# Disable precompiled headers since they aren't generated during linting which causes an error
|
|
# Disable unity builds since clang-tidy needs the full list of compiled files to check each one
|
|
cmake --target Cuberite -DCMAKE_EXPORT_COMPILE_COMMANDS=Yes -DPRECOMPILE_HEADERS=No -DUNITY_BUILDS=No ..
|
|
|
|
# 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
|