2016-02-14 00:56:32 +00:00
|
|
|
#!/bin/sh
|
2017-01-02 21:04:09 +00:00
|
|
|
# Execute lint to spot code mistakes.
|
2015-09-17 07:35:26 +00:00
|
|
|
|
2017-01-05 08:45:14 +00:00
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
|
2016-11-18 05:59:53 +00:00
|
|
|
if [ "$1" = "--changed" ]; then
|
2016-12-20 11:06:53 +00:00
|
|
|
export files="`git diff upstream/dev --name-only | grep -e '\.py$'`"
|
2016-08-23 03:52:31 +00: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
|