summaryrefslogblamecommitdiff
path: root/tools/ci/jobs/clang_tidy.sh
blob: 9e83cbcdf11c1a7cf286c91e600d2cd637c482e7 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                   








                                 
                                                                                                                          
              
                                                                                                                                                       
              
                                                                                                                        




                                     





                                        



                  
#!/usr/bin/env bash

export LOGFILE=tidy.log

source ./tools/ci/scripts/init.sh

rm "logs/clang_tidy.txt"

cd src

find . -type f -name "*.cpp" -exec ../tools/ci/scripts/clang_tidy.sh "${FLAGS}" "${DFLAGS}" {} \; >>../logs/clang_tidy.txt
check_error $?
find . -type f -name "*.cc" -exec ../tools/ci/scripts/clang_tidy.sh "${FLAGS}" "-DUNITTESTS -DUNITTESTS_CATCH ${DFLAGS}" {} \; >>../logs/clang_tidy.txt
check_error $?
find . -type f -name "*.h" -exec ../tools/ci/scripts/clang_tidy.sh "${FLAGS}" "${DFLAGS}" {} \; >>../logs/clang_tidy.txt
check_error $?

cd ..

grep "warning:" logs/clang_tidy.txt \
  | grep -v \
         -e "/src/unittests/doctest.h" \
         -e "/src/unittests/catch.hpp" \
         -e "/src/sdl2gfx/" \
         -e "/src/debug/" \
    ">${ERRFILE}"

run_check_warnings

echo ok