hass-core/script/lint
cdce8p 7ea7fc8d38 Script/lint, Lazytox: Fix issue to ignore delete files (#13051)
* Fix issue to ignore delete files

* Updated lazytox
2018-03-10 09:12:23 -08:00

23 lines
654 B
Bash
Executable file

#!/bin/sh
# Execute lint to spot code mistakes.
cd "$(dirname "$0")/.."
export files="`git diff upstream/dev... --diff-filter=d --name-only | grep -e '\.py$'`"
echo "================================================="
echo "FILES CHANGED (git diff upstream/dev... --diff-filter=d --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