Skip to content

Commit

Permalink
Update black
Browse files Browse the repository at this point in the history
This adopts some new formatting rules.
  • Loading branch information
pgjones committed Jan 30, 2024
1 parent 44f9321 commit a7bd8a4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[flake8]
classmethod-decorators = model_validator
ignore = E203, E252, W503, W504
ignore = E203, E252, E704, W503, W504
max_line_length = 100
7 changes: 3 additions & 4 deletions src/quart_schema/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ def hide(func: Callable) -> Callable:


class QuartSchema:

"""A Quart-Schema instance.
This can be used to initialise Quart-Schema documentation a given
Expand Down Expand Up @@ -593,9 +592,9 @@ def _build_path(func: Callable, rule: Rule, app: Quart) -> Tuple[dict, dict]:
per_method_operation_object = operation_object.copy()

if getattr(func, QUART_SCHEMA_OPERATION_ID_ATTRIBUTE, None) is not None:
per_method_operation_object[
"operationId"
] = f"{method.lower()}_{getattr(func, QUART_SCHEMA_OPERATION_ID_ATTRIBUTE)}"
per_method_operation_object["operationId"] = (
f"{method.lower()}_{getattr(func, QUART_SCHEMA_OPERATION_ID_ATTRIBUTE)}"
)
else:
per_method_operation_object["operationId"] = f"{method.lower()}_{func.__name__}"

Expand Down
9 changes: 3 additions & 6 deletions src/quart_schema/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,9 @@ class DataclassProtocol(Protocol):


class WebsocketProtocol(Protocol):
async def receive_json(self) -> dict:
...
async def receive_json(self) -> dict: ...

async def send_json(self, data: dict) -> None:
...
async def send_json(self, data: dict) -> None: ...


class TestClientProtocol(Protocol):
Expand All @@ -70,5 +68,4 @@ async def _make_request(
root_path: str,
http_version: str,
scope_base: Optional[dict],
) -> Response:
...
) -> Response: ...
8 changes: 5 additions & 3 deletions src/quart_schema/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ def decorator(func: Callable) -> Callable:
@wraps(func)
async def wrapper(*args: Any, **kwargs: Any) -> Any:
request_args = {
key: request.args.getlist(key)
if len(request.args.getlist(key)) > 1
else request.args[key]
key: (
request.args.getlist(key)
if len(request.args.getlist(key)) > 1
else request.args[key]
)
for key in request.args
}
model = model_load(
Expand Down

0 comments on commit a7bd8a4

Please sign in to comment.