Browse Source

🔧 Separate format and lint scripts (#232)

pull/235/head
Sebastián Ramírez 6 years ago
committed by GitHub
parent
commit
fcaff64646
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      scripts/format.sh
  2. 10
      scripts/lint.sh
  3. 4
      scripts/test.sh

6
scripts/format.sh

@ -0,0 +1,6 @@
#!/bin/sh -e
set -x
autoflake --remove-all-unused-imports --recursive --remove-unused-variables --in-place docs/src/ fastapi tests --exclude=__init__.py
black fastapi tests docs/src
isort --multi-line=3 --trailing-comma --force-grid-wrap=0 --combine-as --line-width 88 --recursive --thirdparty fastapi --apply fastapi tests docs/src

10
scripts/lint.sh

@ -1,6 +1,8 @@
#!/bin/sh -e
#!/usr/bin/env bash
set -e
set -x
autoflake --remove-all-unused-imports --recursive --remove-unused-variables --in-place docs/src/ fastapi tests --exclude=__init__.py
black fastapi tests docs/src
isort --multi-line=3 --trailing-comma --force-grid-wrap=0 --combine-as --line-width 88 --recursive --thirdparty fastapi --apply fastapi tests docs/src
mypy fastapi --disallow-untyped-defs --follow-imports=skip
black fastapi tests --check
isort --multi-line=3 --trailing-comma --force-grid-wrap=0 --combine-as --line-width 88 --recursive --check-only --thirdparty fastapi fastapi tests

4
scripts/test.sh

@ -10,6 +10,4 @@ fi
export PYTHONPATH=./docs/src
pytest --cov=fastapi --cov=tests --cov=docs/src --cov-report=term-missing ${@}
mypy fastapi --disallow-untyped-defs --follow-imports=skip
black fastapi tests --check
isort --multi-line=3 --trailing-comma --force-grid-wrap=0 --combine-as --line-width 88 --recursive --check-only --thirdparty fastapi fastapi tests
bash ./scripts/lint.sh

Loading…
Cancel
Save