Skip to content

Commit

Permalink
Merge pull request CleverRaven#78272 from CleverRaven/dont-tidy-nothing
Browse files Browse the repository at this point in the history
Don't Panic and clang-tidy everything if there are no eligible files
  • Loading branch information
akrieger authored Dec 1, 2024
2 parents 549290b + 14197b7 commit 273ef69
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion build-scripts/clang-tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,16 @@ else
includes

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

tidyable_cpp_files="$(echo -n "$tidyable_cpp_files" | grep -v )"
if [ -n "$tidyable_cpp_files" ]
then
echo "No files to tidy, exiting";
set -x
exit 0
fi
if [ "$tidyable_cpp_files" == "unknown" ]
then
echo "Unable to determine affected files, tidying all files"
Expand Down

0 comments on commit 273ef69

Please sign in to comment.