mirror of
https://github.com/fastapi/fastapi.git
synced 2026-05-15 11:16:01 -04:00
👷 Add scripts, stolen from Starlette
This commit is contained in:
5
scripts/lint.sh
Normal file
5
scripts/lint.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh -e
|
||||
set -x
|
||||
|
||||
black fastapi tests
|
||||
isort --multi-line=3 --trailing-comma --force-grid-wrap=0 --combine-as --line-width 88 --recursive --apply fastapi tests
|
||||
15
scripts/test.sh
Normal file
15
scripts/test.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
export VERSION_SCRIPT="import sys; print('%s.%s' % sys.version_info[0:2])"
|
||||
export PYTHON_VERSION=`python -c "$VERSION_SCRIPT"`
|
||||
|
||||
set -x
|
||||
|
||||
PYTHONPATH=. pytest --cov=fastapi --cov=tests --cov-fail-under=100 --cov-report=term-missing ${@} --cov-report=html
|
||||
mypy fastapi --disallow-untyped-defs
|
||||
if [ "${PYTHON_VERSION}" = '3.7' ]; then
|
||||
echo "Skipping 'black' on 3.7. See issue https://github.com/ambv/black/issues/494"
|
||||
else
|
||||
black fastapi tests --check
|
||||
fi
|
||||
isort --multi-line=3 --trailing-comma --force-grid-wrap=0 --combine-as --line-width 88 --recursive --check-only fastapi tests
|
||||
Reference in New Issue
Block a user