1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-26 06:53:52 +01:00

dist/tools/flake8: Allow gh annotation

This commit is contained in:
MrKevinWeiss 2020-12-17 13:17:39 +01:00
parent 6eb8e17861
commit 30fe436ea0

View File

@ -6,6 +6,8 @@
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
. "$(dirname "$0")/../ci/github_annotate.sh"
github_annotate_setup
FLAKE8_CMD="python3 -m flake8"
@ -45,6 +47,18 @@ ${FLAKE8_CMD} --version &> /dev/null || {
ERRORS=$(${FLAKE8_CMD} --config="${RIOTTOOLS}"/flake8/flake8.cfg ${FILES})
if github_annotate_is_on; then
echo "${ERRORS}" | grep "^.\+:[0-9]\+:" | while read line; do
FILENAME=$(echo "${line}" | cut -d: -f1)
LINENR=$(echo "${line}" | cut -d: -f2)
DETAILS=$(echo "${line}" | cut -d: -f4- |
sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
github_annotate_error "${FILENAME}" "${LINENR}" "${DETAILS}"
done
fi
github_annotate_teardown
if [ -n "${ERRORS}" ]
then
printf "%sThere are style issues in the following Python scripts:%s\n\n" "${CERROR}" "${CRESET}"