use ruff linter and formatter

This commit is contained in:
David Lord 2023-11-09 09:20:27 -08:00
parent 14232513fd
commit 54e05a2824
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
26 changed files with 99 additions and 132 deletions

View file

@ -1,7 +1,5 @@
from __future__ import annotations
import typing as t
from flask import Flask
from flask import Response
@ -29,10 +27,10 @@ async def before_async() -> None:
@app.teardown_appcontext
def teardown_sync(exc: t.Optional[BaseException]) -> None:
def teardown_sync(exc: BaseException | None) -> None:
...
@app.teardown_appcontext
async def teardown_async(exc: t.Optional[BaseException]) -> None:
async def teardown_async(exc: BaseException | None) -> None:
...

View file

@ -29,12 +29,12 @@ def hello_json() -> Response:
@app.route("/json/dict")
def hello_json_dict() -> t.Dict[str, t.Any]:
def hello_json_dict() -> dict[str, t.Any]:
return {"response": "Hello, World!"}
@app.route("/json/dict")
def hello_json_list() -> t.List[t.Any]:
def hello_json_list() -> list[t.Any]:
return [{"message": "Hello"}, {"message": "World"}]