mirror of
https://github.com/home-assistant/core.git
synced 2025-08-03 04:35:11 +02:00
New lazytox.py script (#12862)
This commit is contained in:
38
script/lint
38
script/lint
@@ -3,25 +3,21 @@
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
if [ "$1" = "--all" ]; then
|
||||
tox -e lint
|
||||
else
|
||||
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"
|
||||
exit
|
||||
fi
|
||||
printf "%s\n" $files
|
||||
echo "================"
|
||||
echo "LINT with flake8"
|
||||
echo "================"
|
||||
flake8 --doctests $files
|
||||
echo "================"
|
||||
echo "LINT with pylint"
|
||||
echo "================"
|
||||
pylint $files
|
||||
echo
|
||||
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
|
||||
|
Reference in New Issue
Block a user