Use Ruff for linting (#5630)

This commit is contained in:
Sebastián Ramírez
2022-11-13 19:19:04 +01:00
committed by GitHub
parent bcd9ab95e1
commit fa74093440
13 changed files with 51 additions and 37 deletions

View File

@@ -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]

View File

@@ -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

View File

@@ -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