1
0
mirror of https://github.com/home-assistant/core.git synced 2025-06-21 05:27:06 +00:00
cdce8p ffd3889271 Updated script/lint ()
* Compare to common ancestor
* Check if no file was changed
2018-02-22 15:22:59 -08:00

28 lines
688 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 "================================================="
if $files >/dev/null; then
echo "No python file changed"
exit
fi
printf "%s\n" $files
echo "================"
echo "LINT with flake8"
echo "================"
flake8 --doctests $files
echo "================"
echo "LINT with pylint"
echo "================"
pylint $files
echo
else
tox -e lint
fi