diff --git a/dist/tools/cppcheck/check.sh b/dist/tools/cppcheck/check.sh index 8ce836c247..cfb694ce77 100755 --- a/dist/tools/cppcheck/check.sh +++ b/dist/tools/cppcheck/check.sh @@ -80,7 +80,10 @@ if github_annotate_is_on; then DETAILS="${DETAILS} * (reason: "; then + # contributors get confused if CI errors (i.e. non-zero result), but outputs only warnings + # => make all warnings errors on non-zero output. Otherwise, use severity level of output + # to determine annotation type. + if [ ${RESULT} -ne 0 ] || echo "${SEVERITY}" | grep -q "\"; then github_annotate_error "${FILE}" "${LINENUM}" "${DETAILS}" else github_annotate_warning "${FILE}" "${LINENUM}" "${DETAILS}"