mirror of https://github.com/tiangolo/fastapi.git
⬆️ Upgrade development `autoflake`, supporting multi-line imports (#3988)
This commit is contained in:
parent
9229ba8078
commit
ae22bca9fe
|
|
@ -163,20 +163,6 @@ It will also auto-sort all your imports.
|
||||||
|
|
||||||
For it to sort them correctly, you need to have FastAPI installed locally in your environment, with the command in the section above using `--symlink` (or `--pth-file` on Windows).
|
For it to sort them correctly, you need to have FastAPI installed locally in your environment, with the command in the section above using `--symlink` (or `--pth-file` on Windows).
|
||||||
|
|
||||||
### Format imports
|
|
||||||
|
|
||||||
There is another script that formats all the imports and makes sure you don't have unused imports:
|
|
||||||
|
|
||||||
<div class="termy">
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ bash scripts/format-imports.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
As it runs one command after the other and modifies and reverts many files, it takes a bit longer to run, so it might be easier to use `scripts/format.sh` frequently and `scripts/format-imports.sh` only before committing.
|
|
||||||
|
|
||||||
## Docs
|
## Docs
|
||||||
|
|
||||||
First, make sure you set up your environment as described above, that will install all the requirements.
|
First, make sure you set up your environment as described above, that will install all the requirements.
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ doc = [
|
||||||
dev = [
|
dev = [
|
||||||
"python-jose[cryptography] >=3.3.0,<4.0.0",
|
"python-jose[cryptography] >=3.3.0,<4.0.0",
|
||||||
"passlib[bcrypt] >=1.7.2,<2.0.0",
|
"passlib[bcrypt] >=1.7.2,<2.0.0",
|
||||||
"autoflake >=1.3.1,<2.0.0",
|
"autoflake >=1.4.0,<2.0.0",
|
||||||
"flake8 >=3.8.3,<4.0.0",
|
"flake8 >=3.8.3,<4.0.0",
|
||||||
"uvicorn[standard] >=0.12.0,<0.16.0",
|
"uvicorn[standard] >=0.12.0,<0.16.0",
|
||||||
# TODO: remove in the next major version
|
# TODO: remove in the next major version
|
||||||
|
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
#!/bin/sh -e
|
|
||||||
set -x
|
|
||||||
|
|
||||||
# Sort imports one per line, so autoflake can remove unused imports
|
|
||||||
isort fastapi tests docs_src scripts --force-single-line-imports
|
|
||||||
sh ./scripts/format.sh
|
|
||||||
Loading…
Reference in New Issue