You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

18 lines
599 B

#!/bin/bash
# Find all C++ files in the project directory and its subdirectories
files=$(find . -name "*.cpp")
for file in $files; do
echo "Running clang-tidy for file: $file"
clangTidyOutput=$(clang-tidy "$file" -- -I/usr/include/c++/11 -I/usr/include/x86_64-linux-gnu/c++/11 -DMY_DEFINES ...)
echo "$clangTidyOutput"
# Check if clang-tidy found any warnings
if [[ $clangTidyOutput == *"warning:"* ]]; then
echo "clang-tidy found warnings in file: $file"
echo "$clangTidyOutput"
exit 1
fi
done
echo "clang-tidy done successful for all files."