1
0
mirror of https://github.com/home-assistant/core.git synced 2025-08-19 02:10:12 +00:00
Files
.github
docs
homeassistant
script
bootstrap
check_dirty
dev_docker
dev_openzwave_docker
gen_requirements_all.py
inspect_schemas.py
lazytox.py
lint
lint_docker
monkeytype
release
server
setup
test
test_docker
translations_develop
translations_download
translations_download_split.py
translations_upload
translations_upload_merge.py
travis_deploy
update
version_bump.py
tests
virtualization
.coveragerc
.dockerignore
.gitattributes
.gitignore
.hound.yml
.ignore
.readthedocs.yml
.travis.yml
CLA.md
CODEOWNERS
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Dockerfile
LICENSE.md
MANIFEST.in
README.rst
mypy.ini
pylintrc
requirements_all.txt
requirements_docs.txt
requirements_test.txt
requirements_test_all.txt
setup.cfg
setup.py
tox.ini
core/script/lint

29 lines
804 B
Bash
Executable File

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