Format
Signed-off-by: András Schmelczer <andras@schmelczer.dev>
This commit is contained in:
parent
d79a75d352
commit
ea54cd9c8c
13 changed files with 168 additions and 116 deletions
20
format-python.sh
Executable file
20
format-python.sh
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
echo "Installing dependencies if necessary"
|
||||
python3 -m pip install --upgrade autoflake isort black black[jupyter] mypy
|
||||
|
||||
echo "Formatting and checking $1"
|
||||
|
||||
echo Running autoflake
|
||||
python3 -m autoflake --expand-star-imports --remove-all-unused-imports --ignore-init-module-imports --remove-unused-variables --in-place -r $1
|
||||
|
||||
echo Running isort
|
||||
python3 -m isort --profile black --skip .env $1
|
||||
|
||||
echo Running black
|
||||
python3 -m black $1 --exclude .env
|
||||
|
||||
echo Running mypy
|
||||
python3 -m mypy --namespace-packages --ignore-missing-imports --install-types --non-interactive --disallow-untyped-defs --disallow-incomplete-defs --pretty --follow-imports=silent --exclude=external/ --exclude=/build/ $1
|
||||
Loading…
Add table
Add a link
Reference in a new issue