hass-core/script/lint
Michaël Arnauts cb85128304 Speeds up lint and test in docker by keeping the cache between invocations. (#5177)
* Add a volume to store the tox cache on the host. This gives quite some speed boost when running lint_docker and test_docker.

* Only map .tox directory for cache.
2017-01-05 09:45:14 +01:00

23 lines
597 B
Bash
Executable file

#!/bin/sh
# Execute lint to spot code mistakes.
cd "$(dirname "$0")/.."
if [ "$1" = "--changed" ]; then
export files="`git diff upstream/dev --name-only | grep -e '\.py$'`"
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