dist/tools/doccheck: annotate errors in Github Action
This commit is contained in:
parent
db81377af7
commit
9ee568e319
70
dist/tools/doccheck/check.sh
vendored
70
dist/tools/doccheck/check.sh
vendored
@ -10,6 +10,10 @@
|
|||||||
|
|
||||||
RIOTBASE="$(cd $(dirname $0)/../../..; pwd)"
|
RIOTBASE="$(cd $(dirname $0)/../../..; pwd)"
|
||||||
|
|
||||||
|
. ${RIOTBASE}/dist/tools/ci/github_annotate.sh
|
||||||
|
|
||||||
|
github_annotate_setup
|
||||||
|
|
||||||
if tput colors &> /dev/null && [ $(tput colors) -ge 8 ]; then
|
if tput colors &> /dev/null && [ $(tput colors) -ge 8 ]; then
|
||||||
CERROR="\e[1;31m"
|
CERROR="\e[1;31m"
|
||||||
CWARN="\033[1;33m"
|
CWARN="\033[1;33m"
|
||||||
@ -32,8 +36,19 @@ if [ "${DOXY_ERRCODE}" -ne 0 ] ; then
|
|||||||
else
|
else
|
||||||
ERRORS=$(echo "${DOXY_OUTPUT}" | grep '.*warning' | sed "s#${PWD}/\([^:]*\)#\1#g")
|
ERRORS=$(echo "${DOXY_OUTPUT}" | grep '.*warning' | sed "s#${PWD}/\([^:]*\)#\1#g")
|
||||||
if [ -n "${ERRORS}" ] ; then
|
if [ -n "${ERRORS}" ] ; then
|
||||||
echo -e "${CERROR}ERROR: Doxygen generates the following warnings:${CRESET}"
|
if github_annotate_is_on; then
|
||||||
echo "${ERRORS}"
|
echo "${ERRORS}" | grep "^.\+:[0-9]\+: warning:" | while read error_line
|
||||||
|
do
|
||||||
|
FILENAME=$(echo "${error_line}" | cut -d: -f1)
|
||||||
|
LINENR=$(echo "${error_line}" | cut -d: -f2)
|
||||||
|
DETAILS=$(echo "${error_line}" | cut -d: -f4- |
|
||||||
|
sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
|
||||||
|
github_annotate_error "${FILENAME}" "${LINENR}" "${DETAILS}"
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo -e "${CERROR}ERROR: Doxygen generates the following warnings:${CRESET}"
|
||||||
|
echo "${ERRORS}"
|
||||||
|
fi
|
||||||
RESULT=2
|
RESULT=2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -44,8 +59,8 @@ exclude_filter() {
|
|||||||
|
|
||||||
# Check groups are correctly defined (e.g. no undefined groups and no group
|
# Check groups are correctly defined (e.g. no undefined groups and no group
|
||||||
# defined multiple times)
|
# defined multiple times)
|
||||||
ALL_RAW_DEFGROUP=$(git grep @defgroup -- '*.h' '*.c' '*.txt' | exclude_filter)
|
ALL_RAW_DEFGROUP=$(git grep -n @defgroup -- '*.h' '*.c' '*.txt' | exclude_filter)
|
||||||
ALL_RAW_INGROUP=$(git grep '@ingroup' -- '*.h' '*.c' '*.txt' | exclude_filter)
|
ALL_RAW_INGROUP=$(git grep -n '@ingroup' -- '*.h' '*.c' '*.txt' | exclude_filter)
|
||||||
DEFINED_GROUPS=$(echo "${ALL_RAW_DEFGROUP}" | \
|
DEFINED_GROUPS=$(echo "${ALL_RAW_DEFGROUP}" | \
|
||||||
grep -oE '@defgroup[ ]+[^ ]+' | \
|
grep -oE '@defgroup[ ]+[^ ]+' | \
|
||||||
grep -oE '[^ ]+$' | \
|
grep -oE '[^ ]+$' | \
|
||||||
@ -65,12 +80,26 @@ if [ -n "${UNDEFINED_GROUPS}" ]
|
|||||||
then
|
then
|
||||||
COUNT=$(echo "${UNDEFINED_GROUPS}" | wc -l)
|
COUNT=$(echo "${UNDEFINED_GROUPS}" | wc -l)
|
||||||
echo -ne "\n\n${CERROR}ERROR${CRESET} "
|
echo -ne "\n\n${CERROR}ERROR${CRESET} "
|
||||||
echo -e "There are ${CWARN}${COUNT}${CRESET} undefined Doxygen groups:"
|
echo -ne "There are ${CWARN}${COUNT}${CRESET} undefined Doxygen groups"
|
||||||
|
if github_annotate_is_on; then
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
echo ":"
|
||||||
|
fi
|
||||||
for group in ${UNDEFINED_GROUPS};
|
for group in ${UNDEFINED_GROUPS};
|
||||||
do
|
do
|
||||||
echo -e "\n${CWARN}${group}${CRESET} found in:";
|
INGROUPS=$(echo "${ALL_RAW_INGROUP}" | grep "\<${group}\>$" | sort -u)
|
||||||
echo "${ALL_RAW_INGROUP}" | grep "\<${group}\>$" | sort -u |
|
if github_annotate_is_on; then
|
||||||
awk -F: '{ print "\t" $1 }';
|
echo "${INGROUPS}" | while read ingroup;
|
||||||
|
do
|
||||||
|
github_annotate_error \
|
||||||
|
$(echo ${ingroup} | awk -F: '{ print $1,$2 }') \
|
||||||
|
"Undefined doxygen group '${group}'"
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo -e "\n${CWARN}${group}${CRESET} found in:";
|
||||||
|
echo "${INGROUPS}" | awk -F: '{ print "\t" $1 }';
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
RESULT=2
|
RESULT=2
|
||||||
fi
|
fi
|
||||||
@ -82,15 +111,30 @@ if [ -n "${MULTIPLE_DEFINED_GROUPS}" ]
|
|||||||
then
|
then
|
||||||
COUNT=$(echo "${MULTIPLE_DEFINED_GROUPS}" | wc -l)
|
COUNT=$(echo "${MULTIPLE_DEFINED_GROUPS}" | wc -l)
|
||||||
echo -ne "\n\n${CERROR}ERROR${CRESET} "
|
echo -ne "\n\n${CERROR}ERROR${CRESET} "
|
||||||
echo -e "There are ${CWARN}${COUNT}${CRESET} Doxygen groups defined multiple times:"
|
echo -ne "There are ${CWARN}${COUNT}${CRESET} Doxygen groups defined multiple times"
|
||||||
|
if github_annotate_is_on; then
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
echo ":"
|
||||||
|
fi
|
||||||
for group in ${MULTIPLE_DEFINED_GROUPS};
|
for group in ${MULTIPLE_DEFINED_GROUPS};
|
||||||
do
|
do
|
||||||
echo -e "\n${CWARN}${group}${CRESET} defined in:";
|
DEFGROUPS=$(echo "${ALL_RAW_DEFGROUP}" |
|
||||||
echo "${ALL_RAW_DEFGROUP}" | \
|
|
||||||
awk -F@ '{ split($2, end, " "); printf("%s%s\n",$1,end[2]) }' |
|
awk -F@ '{ split($2, end, " "); printf("%s%s\n",$1,end[2]) }' |
|
||||||
grep "\<${group}\>$" | sort -u |
|
grep "\<${group}\>$" | sort -u)
|
||||||
awk -F: '{ print "\t" $1 }';
|
DEFGROUPFILES=$(echo "${DEFGROUPS}" | awk -F: '{ print "\t" $1 }')
|
||||||
|
if github_annotate_is_on; then
|
||||||
|
echo "${DEFGROUPS}" | while read defgroup;
|
||||||
|
do
|
||||||
|
github_annotate_error $(echo ${defgroup} | awk -F: '{ print $1,$2 }') \
|
||||||
|
"Multiple doxygen group definitions of '${group}' in\n${DEFGROUPFILES}"
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo -e "\n${CWARN}${group}${CRESET} defined in:";
|
||||||
|
echo "${DEFGROUPFILES}"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
RESULT=2
|
RESULT=2
|
||||||
fi
|
fi
|
||||||
|
github_annotate_teardown
|
||||||
exit ${RESULT}
|
exit ${RESULT}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user