Signed-off-by: András Schmelczer <andras@schmelczer.dev>
This commit is contained in:
Andras Schmelczer 2022-04-02 13:57:16 +02:00
parent 889e79174b
commit 60cd55c0cd
No known key found for this signature in database
GPG key ID: 39260B5B0614A13E
13 changed files with 168 additions and 116 deletions

17
check-python.sh Executable file
View file

@ -0,0 +1,17 @@
#!/bin/sh
set -e
echo "Installing dependencies if necessary"
python3 -m pip install --upgrade autoflake isort black black[jupyter] mypy flake8
echo "Checking $1"
python3 -m autoflake --expand-star-imports --remove-all-unused-imports --ignore-init-module-imports --remove-unused-variables --in-place -r $1 --check
python3 -m isort --profile black --skip .env $1 --check
python3 -m black $1 --exclude .env --check
yes | python3 -m mypy $1 --install-types > /dev/null || true
python3 -m mypy --namespace-packages --ignore-missing-imports --install-types --non-interactive --disallow-untyped-defs --disallow-incomplete-defs --follow-imports=silent --exclude=external/ --exclude=/build/ --pretty $1
python3 -m flake8 $1 --count --show-source --statistics --exclude=__init__.py,.env,external --ignore=E501,E402,F821,W503,E722,E203