mirror of
https://github.com/fastapi/fastapi.git
synced 2026-05-18 13:27:45 -04:00
✨ Use Ruff for linting (#5630)
This commit is contained in:
committed by
GitHub
parent
bcd9ab95e1
commit
fa74093440
@@ -332,7 +332,7 @@ def serve():
|
||||
os.chdir("site")
|
||||
server_address = ("", 8008)
|
||||
server = HTTPServer(server_address, SimpleHTTPRequestHandler)
|
||||
typer.echo(f"Serving at: http://127.0.0.1:8008")
|
||||
typer.echo("Serving at: http://127.0.0.1:8008")
|
||||
server.serve_forever()
|
||||
|
||||
|
||||
@@ -420,7 +420,7 @@ def get_file_to_nav_map(nav: list) -> Dict[str, Tuple[str, ...]]:
|
||||
file_to_nav = {}
|
||||
for item in nav:
|
||||
if type(item) is str:
|
||||
file_to_nav[item] = tuple()
|
||||
file_to_nav[item] = ()
|
||||
elif type(item) is dict:
|
||||
item_key = list(item.keys())[0]
|
||||
sub_nav = item[item_key]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh -e
|
||||
set -x
|
||||
|
||||
autoflake --remove-all-unused-imports --recursive --remove-unused-variables --in-place docs_src fastapi tests scripts --exclude=__init__.py
|
||||
ruff fastapi tests docs_src scripts --fix
|
||||
black fastapi tests docs_src scripts
|
||||
isort fastapi tests docs_src scripts
|
||||
|
||||
@@ -4,6 +4,6 @@ set -e
|
||||
set -x
|
||||
|
||||
mypy fastapi
|
||||
flake8 fastapi tests
|
||||
ruff fastapi tests docs_src scripts
|
||||
black fastapi tests --check
|
||||
isort fastapi tests docs_src scripts --check-only
|
||||
|
||||
Reference in New Issue
Block a user