Skip to content

Commit

Permalink
ci: don't check for affected files (for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
scarf005 committed Oct 3, 2023
1 parent bb22f99 commit ae0bda3
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions build-scripts/clang-tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ cmake_extra_opts=()
if [ "$CATA_CLANG_TIDY" = "plugin" ]
then
cmake_extra_opts+=("-DCATA_CLANG_TIDY_PLUGIN=ON")
# Need to specify the particular LLVM / Clang versions to use, lest it
# use the older LLVM that comes by default on Ubuntu.
# At least llvm-16 is needed for the plugin feature to work.
cmake_extra_opts+=("-DLLVM_DIR=/usr/lib/llvm-16/lib/cmake/llvm")
cmake_extra_opts+=("-DClang_DIR=/usr/lib/llvm-16/lib/cmake/clang")
fi
Expand Down Expand Up @@ -72,27 +71,27 @@ if [ "$TIDY" == "all" ]
then
echo "Analyzing all files"
tidyable_cpp_files=$all_cpp_files
else
elif [ "$TIDY" == "affected" ] # temporarily disabled via flag until most of the checks are fixed
then
make \
-j $num_jobs \
${COMPILER:+COMPILER=$COMPILER} \
TILES=${TILES:-0} \
SOUND=${SOUND:-0} \
includes

tidyable_cpp_files="$( \
( test -f ./files_changed && build-scripts/get_affected_files.py ./files_changed ) || \
echo unknown )"

if [ "tidyable_cpp_files" == "unknown" ]
then
echo "Unable to determine affected files"
else
echo "Affected files:"
echo "$tidyable_cpp_files"
fi
tidyable_cpp_files="$(test -f ./files_changed && build-scripts/get_affected_files.py ./files_changed || echo 'empty')"
else
tidyable_cpp_files="$(test -f ./files_changed && grep -E '^(src|tests)/.*\.cpp$' ./files_changed || echo 'empty')"
fi

if [ "$tidyable_cpp_files" == "empty" ]
then
echo "Unable to determine affected files"
else
echo "Affected files:"
echo "$tidyable_cpp_files"
fi

# We might need to analyze only a subset of the files if they have been split
# into multiple jobs for efficiency. The paths from `compile_commands.json` can
Expand Down

0 comments on commit ae0bda3

Please sign in to comment.