1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 22:43:50 +01:00

Merge pull request #15663 from MrKevinWeiss/pr/tools/flake8/ghanno

dist/tools/flake8: Allow gh annotation
This commit is contained in:
Martine Lenders 2020-12-17 17:30:06 +01:00 committed by GitHub
commit b45363b784
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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}"