2015-03-10 13:09:31 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-06-08 17:58:23 +01:00
|
|
|
DEFAULT_DIRS=(
|
2018-05-17 17:28:55 +01:00
|
|
|
wa
|
2015-06-08 17:58:23 +01:00
|
|
|
)
|
|
|
|
|
2018-07-05 10:46:47 +01:00
|
|
|
EXCLUDE=wa/tests,wa/framework/target/descriptor.py
|
2018-05-17 17:28:55 +01:00
|
|
|
EXCLUDE_COMMA=
|
2020-10-19 18:09:04 +01:00
|
|
|
IGNORE=E501,E265,E266,W391,E401,E402,E731,W503,W605,F401
|
2015-03-10 13:09:31 +00:00
|
|
|
|
2018-07-05 10:46:47 +01:00
|
|
|
if ! hash flake8 2>/dev/null; then
|
|
|
|
echo "flake8 not found in PATH"
|
2018-07-06 10:13:13 +01:00
|
|
|
echo "you can install it with \"sudo pip install flake8\""
|
2015-03-10 13:09:31 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "$1" == "" ]]; then
|
|
|
|
THIS_DIR="`dirname \"$0\"`"
|
|
|
|
pushd $THIS_DIR/.. > /dev/null
|
2015-06-08 17:58:23 +01:00
|
|
|
for dir in "${DEFAULT_DIRS[@]}"; do
|
2018-07-05 10:46:47 +01:00
|
|
|
flake8 --exclude=$EXCLUDE,$EXCLUDE_COMMA --ignore=$IGNORE $dir
|
2015-06-08 17:58:23 +01:00
|
|
|
done
|
2018-07-05 10:46:47 +01:00
|
|
|
flake8 --exclude=$EXCLUDE --ignore=$IGNORE,E241 $(echo "$EXCLUDE_COMMA" | sed 's/,/ /g')
|
2015-03-10 13:09:31 +00:00
|
|
|
popd > /dev/null
|
|
|
|
else
|
2018-07-05 10:46:47 +01:00
|
|
|
flake8 --exclude=$EXCLUDE,$EXCLUDE_COMMA --ignore=$IGNORE $1
|
2015-03-10 13:09:31 +00:00
|
|
|
fi
|
|
|
|
|