use ruff linter and formatter
This commit is contained in:
parent
14232513fd
commit
54e05a2824
26 changed files with 99 additions and 132 deletions
|
|
@ -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:
|
||||
...
|
||||
|
|
|
|||
|
|
@ -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"}]
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue