diff --git a/cppcheck_configs/cpp_check_scripts.sh b/cppcheck_configs/cpp_check_scripts.sh new file mode 100644 index 0000000..7c60220 --- /dev/null +++ b/cppcheck_configs/cpp_check_scripts.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Find all C++ files in the project directory and its subdirectories +files=$(find . -name "*.cpp") + +# Iterate over each file +for file in $files; do + # Run cppcheck for the current file and capture its output in XML format + cppcheck --enable=all --suppress=missingIncludeSystem --xml --language=c++ -i cppcheck.xml --enable=all --inconclusive --debug --template=gcc "$file" 2>> cppcheck-result.xml + + # Read the cppcheck result XML file for the current file + cppcheckOutput=$(cat cppcheck-result.xml) + + # Check if cppcheck found any errors for the current file + if grep -q '