2016-02-13 19:56:32 -05:00
|
|
|
#!/bin/sh
|
2017-01-02 22:04:09 +01:00
|
|
|
# Execute lint to spot code mistakes.
|
2015-09-17 00:35:26 -07:00
|
|
|
|
2017-01-05 09:45:14 +01:00
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
|
2016-11-18 06:59:53 +01:00
|
|
|
if [ "$1" = "--changed" ]; then
|
2016-12-20 12:06:53 +01:00
|
|
|
export files="`git diff upstream/dev --name-only | grep -e '\.py$'`"
|
2016-08-23 05:52:31 +02:00
|
|
|
echo "================================================="
|
|
|
|
echo "FILES CHANGED (git diff upstream/dev --name-only)"
|
|
|
|
echo "================================================="
|
|
|
|
echo $files
|
|
|
|
echo "================"
|
|
|
|
echo "LINT with flake8"
|
|
|
|
echo "================"
|
|
|
|
flake8 --doctests $files
|
|
|
|
echo "================"
|
|
|
|
echo "LINT with pylint"
|
|
|
|
echo "================"
|
|
|
|
pylint $files
|
|
|
|
echo
|
|
|
|
else
|
|
|
|
tox -e lint
|
|
|
|
fi
|