Skip to content
Snippets Groups Projects
Unverified Commit 28f11626 authored by Alexandre Abadie's avatar Alexandre Abadie Committed by GitHub
Browse files

Merge pull request #9056 from bergzand/pr/flake8/shellcheck

tools/flake8: fix shellcheck issues
parents 4948cd01 1592de7b
No related branches found
No related tags found
No related merge requests found
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
FLAKE8_CMD="python3 -m flake8" FLAKE8_CMD="python3 -m flake8"
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=$'\033[1;31m'
CRESET="\e[0m" CRESET=$'\033[0m'
else else
CERROR= CERROR=
CRESET= CRESET=
...@@ -19,7 +19,7 @@ fi ...@@ -19,7 +19,7 @@ fi
DIST_TOOLS=${RIOTBASE:-.}/dist/tools DIST_TOOLS=${RIOTBASE:-.}/dist/tools
. ${DIST_TOOLS}/ci/changed_files.sh . "${DIST_TOOLS}/ci/changed_files.sh"
FILES=$(FILEREGEX='(?=*.py$|pyterm$)' changed_files) FILES=$(FILEREGEX='(?=*.py$|pyterm$)' changed_files)
...@@ -29,16 +29,16 @@ then ...@@ -29,16 +29,16 @@ then
fi fi
${FLAKE8_CMD} --version &> /dev/null || { ${FLAKE8_CMD} --version &> /dev/null || {
printf "${CERROR}$0: cannot execute \"${FLAKE8_CMD}\"!${CRESET}\n" printf "%s%s: cannot execute \"%s\"!%s\n" "${CERROR}" "$0" "${FLAKE8_CMD}" "${CRESET}"
exit 1 exit 1
} }
ERRORS=$(${FLAKE8_CMD} --config=${DIST_TOOLS}/flake8/flake8.cfg ${FILES}) ERRORS=$(${FLAKE8_CMD} --config="${DIST_TOOLS}/flake8/flake8.cfg" ${FILES})
if [ -n "${ERRORS}" ] if [ -n "${ERRORS}" ]
then then
printf "${CERROR}There are style issues in the following Python scripts:${CRESET}\n\n" printf "%sThere are style issues in the following Python scripts:%s\n\n" "${CERROR}" "${CRESET}"
printf "${ERRORS}\n" printf "%s\n" "${ERRORS}"
exit 1 exit 1
else else
exit 0 exit 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment