clang_tidy.sh 775 B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env bash
  2. export LOGFILE=tidy.log
  3. source ./tools/ci/scripts/init.sh
  4. rm "logs/clang_tidy.txt"
  5. cd src
  6. find . -type f -name "*.cpp" -exec ../tools/ci/scripts/clang_tidy.sh "${FLAGS}" "${DFLAGS}" {} \; >>../logs/clang_tidy.txt
  7. check_error $?
  8. find . -type f -name "*.cc" -exec ../tools/ci/scripts/clang_tidy.sh "${FLAGS}" "-DUNITTESTS -DUNITTESTS_CATCH ${DFLAGS}" {} \; >>../logs/clang_tidy.txt
  9. check_error $?
  10. find . -type f -name "*.h" -exec ../tools/ci/scripts/clang_tidy.sh "${FLAGS}" "${DFLAGS}" {} \; >>../logs/clang_tidy.txt
  11. check_error $?
  12. cd ..
  13. grep "warning:" logs/clang_tidy.txt \
  14. | grep -v "/src/unittests/doctest.h" \
  15. | grep -v "/src/unittests/catch.hpp" \
  16. | grep -v "/src/sdl2gfx/" \
  17. | grep -v "/src/debug/" \
  18. >${ERRFILE}
  19. run_check_warnings
  20. echo ok