Merge pull request #9056 from bergzand/pr/flake8/shellcheck
tools/flake8: fix shellcheck issues
This commit is contained in:
commit
28f11626a9
16
dist/tools/flake8/check.sh
vendored
16
dist/tools/flake8/check.sh
vendored
@ -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
|
|||||||
|
|
||||||
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
|
|||||||
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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user