hass-core/script/lint
2018-03-09 22:27:39 +02:00

23 lines
622 B
Bash
Executable file

#!/bin/sh
# Execute lint to spot code mistakes.
cd "$(dirname "$0")/.."
export files="`git diff upstream/dev... --name-only | grep -e '\.py$'`"
echo "================================================="
echo "FILES CHANGED (git diff upstream/dev... --name-only)"
echo "================================================="
if [ -z "$files" ] ; then
echo "No python file changed. Rather use: tox -e lint"
exit
fi
printf "%s\n" $files
echo "================"
echo "LINT with flake8"
echo "================"
flake8 --doctests $files
echo "================"
echo "LINT with pylint"
echo "================"
pylint $files
echo