| 1 | #!/bin/sh -e |
| 2 | |
| 3 | std="c99" |
| 4 | |
| 5 | run_cppcheck() { |
| 6 | cppcheck --std="$std" --enable=performance,portability \ |
| 7 | --force --quiet --inline-suppr --error-exitcode=1 \ |
| 8 | --max-ctu-depth=8 -j"$(nproc)" \ |
| 9 | $(make OPT_DEP_DEFAULT="$1" dump_cppflags) \ |
| 10 | --suppress=varFuncNullUB --suppress=uninitvar \ |
| 11 | *.c |
| 12 | } |
| 13 | |
| 14 | run_tidy() { |
| 15 | checks="$(sed '/^#/d' etc/woodpecker/clang-tidy-checks | paste -d ',' -s)" |
| 16 | clang-tidy --warnings-as-errors="*" --checks="$checks" --quiet *.c \ |
| 17 | -- -std="$std" $(make OPT_DEP_DEFAULT="$1" dump_cppflags) |
| 18 | } |
| 19 | |
| 20 | run_cppcheck "0"; run_cppcheck "1"; |
| 21 | run_tidy "0"; run_tidy "1"; |