1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-18 20:11:20 +00:00

dev_scripts: switch from pep8 to flake8

The pep8 code checker is deprecated and will be removed in the future.
Switch to using its successor, flake8.

Also, add a couple of more entries to ignored exceptions.
This commit is contained in:
Sergei Trofimov 2018-07-05 10:46:47 +01:00 committed by Marc Bonnici
parent dbea1d7d09
commit 651adaaa57
2 changed files with 9 additions and 9 deletions

View File

@ -15,8 +15,8 @@ Scripts
:get_apk_versions: Prints out a table of APKs and their versons found under the :get_apk_versions: Prints out a table of APKs and their versons found under the
path specified as the argument. path specified as the argument.
:pep8: Runs pep8 code checker (must be installed) over wlauto with the correct :pep8: Runs flake8 (formerly called "pep8") code checker (must be
settings for WA. installed) over wa/ with the correct settings for WA.
:pylint: Runs pylint (must be installed) over wlauto with the correct settings :pylint: Runs pylint (must be installed) over wlauto with the correct settings
for WA. for WA.

View File

@ -4,12 +4,12 @@ DEFAULT_DIRS=(
wa wa
) )
EXCLUDE=wa/tests EXCLUDE=wa/tests,wa/framework/target/descriptor.py
EXCLUDE_COMMA= EXCLUDE_COMMA=
IGNORE=E501,E265,E266,W391,E401,E402,E731 IGNORE=E501,E265,E266,W391,E401,E402,E731,W504,W605,F401
if ! hash pep8 2>/dev/null; then if ! hash flake8 2>/dev/null; then
echo "pep8 not found in PATH" echo "flake8 not found in PATH"
echo "you can install it with \"sudo pip install pep8\"" echo "you can install it with \"sudo pip install pep8\""
exit 1 exit 1
fi fi
@ -18,11 +18,11 @@ if [[ "$1" == "" ]]; then
THIS_DIR="`dirname \"$0\"`" THIS_DIR="`dirname \"$0\"`"
pushd $THIS_DIR/.. > /dev/null pushd $THIS_DIR/.. > /dev/null
for dir in "${DEFAULT_DIRS[@]}"; do for dir in "${DEFAULT_DIRS[@]}"; do
pep8 --exclude=$EXCLUDE,$EXCLUDE_COMMA --ignore=$IGNORE $dir flake8 --exclude=$EXCLUDE,$EXCLUDE_COMMA --ignore=$IGNORE $dir
done done
pep8 --exclude=$EXCLUDE --ignore=$IGNORE,E241 $(echo "$EXCLUDE_COMMA" | sed 's/,/ /g') flake8 --exclude=$EXCLUDE --ignore=$IGNORE,E241 $(echo "$EXCLUDE_COMMA" | sed 's/,/ /g')
popd > /dev/null popd > /dev/null
else else
pep8 --exclude=$EXCLUDE,$EXCLUDE_COMMA --ignore=$IGNORE $1 flake8 --exclude=$EXCLUDE,$EXCLUDE_COMMA --ignore=$IGNORE $1
fi fi