]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
⬆️ Upgrade development `autoflake`, supporting multi-line imports (#3988)
authorSebastián Ramírez <tiangolo@gmail.com>
Tue, 5 Oct 2021 10:17:31 +0000 (12:17 +0200)
committerGitHub <noreply@github.com>
Tue, 5 Oct 2021 10:17:31 +0000 (10:17 +0000)
docs/en/docs/contributing.md
pyproject.toml
scripts/format-imports.sh [deleted file]

index cd87faa4eb77e2a28a1b6d124e161aecf8cdd5ef..9ef6e22c8439551835d0a35877feb08cd36ec6c7 100644 (file)
@@ -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).
 
-### 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
 
 First, make sure you set up your environment as described above, that will install all the requirements.
index 06802aba95e027cff852616b5b28ac20b8f0634f..5b6b272a7bdc3adcf145409731ac9b3e07534f59 100644 (file)
@@ -82,7 +82,7 @@ doc = [
 dev = [
     "python-jose[cryptography] >=3.3.0,<4.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",
     "uvicorn[standard] >=0.12.0,<0.16.0",
     # TODO: remove in the next major version
diff --git a/scripts/format-imports.sh b/scripts/format-imports.sh
deleted file mode 100755 (executable)
index 1fe193b..0000000
+++ /dev/null
@@ -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