1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-15 17:43:51 +01:00

cppcheck: output all annotations as error on script error

`cppcheck` has a non-zero exit code even on warnings, so to not confuse
contributors, align the annotation output with that.
This commit is contained in:
Martine Lenders 2021-11-04 13:29:13 +01:00
parent b0d5e9a027
commit ca32d7704f
No known key found for this signature in database
GPG Key ID: 2134D77A5336DD80

View File

@ -80,7 +80,10 @@ if github_annotate_is_on; then
DETAILS="${DETAILS} * (reason: <your reason why you think this is " DETAILS="${DETAILS} * (reason: <your reason why you think this is "
DETAILS="${DETAILS}a false positive>) */\n" DETAILS="${DETAILS}a false positive>) */\n"
if echo "${SEVERITY}" | grep -q "\<error\>"; 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 "\<error\>"; then
github_annotate_error "${FILE}" "${LINENUM}" "${DETAILS}" github_annotate_error "${FILE}" "${LINENUM}" "${DETAILS}"
else else
github_annotate_warning "${FILE}" "${LINENUM}" "${DETAILS}" github_annotate_warning "${FILE}" "${LINENUM}" "${DETAILS}"