| 1 | pipeline: |
| 2 | analysis: |
| 3 | image: alpine |
| 4 | when: |
| 5 | branch: master |
| 6 | commands: | |
| 7 | apk add --no-cache build-base cppcheck clang-extra-tools \ |
| 8 | imlib2-dev xorgproto \ |
| 9 | libxft-dev libexif-dev giflib-dev libwebp-dev >/dev/null |
| 10 | make config.h version.h |
| 11 | std="c99" |
| 12 | run_cppcheck() { |
| 13 | cppcheck --std="$std" --enable=performance,portability \ |
| 14 | --force --quiet --inline-suppr --error-exitcode=1 \ |
| 15 | --max-ctu-depth=8 -j"$(nproc)" \ |
| 16 | $(make OPT_DEP_DEFAULT="$1" dump_cppflags) \ |
| 17 | --suppress=varFuncNullUB \ |
| 18 | *.c |
| 19 | } |
| 20 | run_tidy() { |
| 21 | checks="$(sed '/^#/d' .woodpecker/clang-tidy-checks | paste -d ',' -s)" |
| 22 | clang-tidy --warnings-as-errors="*" --checks="$checks" --quiet *.c \ |
| 23 | -- -std="$std" $(make OPT_DEP_DEFAULT="$1" dump_cppflags) |
| 24 | } |
| 25 | run_cppcheck "0" |
| 26 | run_cppcheck "1" |
| 27 | run_tidy "0" |
| 28 | run_tidy "1" |