Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#3270)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.1.6 → v0.2.0](astral-sh/ruff-pre-commit@v0.1.6...v0.2.0)
- [github.com/pre-commit/mirrors-prettier: v3.1.0 → v4.0.0-alpha.8](pre-commit/mirrors-prettier@v3.1.0...v4.0.0-alpha.8)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Feb 5, 2024
1 parent 531e37e commit 6123d62
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
rev: v0.2.0
hooks:
- id: ruff-format
exclude: ^tests/\w+/snapshots/
Expand All @@ -14,7 +14,7 @@ repos:
exclude: (CHANGELOG|TWEET).md

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
rev: v4.0.0-alpha.8
hooks:
- id: prettier
files: '^docs/.*\.mdx?$'
Expand Down
5 changes: 2 additions & 3 deletions strawberry/experimental/pydantic/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
Any,
List,
NamedTuple,
NoReturn,
Set,
Tuple,
Type,
Expand Down Expand Up @@ -126,7 +125,7 @@ def get_default_factory_for_field(

def ensure_all_auto_fields_in_pydantic(
model: Type[BaseModel], auto_fields: Set[str], cls_name: str
) -> Union[NoReturn, None]:
) -> None:
# Raise error if user defined a strawberry.auto field not present in the model
non_existing_fields = list(auto_fields - get_model_fields(model).keys())

Expand All @@ -135,4 +134,4 @@ def ensure_all_auto_fields_in_pydantic(
fields=non_existing_fields, cls_name=cls_name, model=model
)
else:
return None
return
2 changes: 1 addition & 1 deletion strawberry/extensions/max_aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(self, validation_context: ValidationContext):


def count_fields_with_alias(
selection_set_owner: Union[ExecutableDefinitionNode, FieldNode, InlineFragmentNode]
selection_set_owner: Union[ExecutableDefinitionNode, FieldNode, InlineFragmentNode],
) -> int:
if selection_set_owner.selection_set is None:
return 0
Expand Down
2 changes: 1 addition & 1 deletion strawberry/utils/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def _ast_replace_union_operation(expr: ast.Expr) -> ast.Expr:


def _ast_replace_union_operation(
expr: Union[ast.Expr, ast.expr]
expr: Union[ast.Expr, ast.expr],
) -> Union[ast.Expr, ast.expr]:
if isinstance(expr, ast.Expr) and isinstance(
expr.value, (ast.BinOp, ast.Subscript)
Expand Down
10 changes: 5 additions & 5 deletions tests/aiohttp/test_websockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


async def test_turning_off_graphql_ws(
aiohttp_client: Callable[..., Awaitable[TestClient]]
aiohttp_client: Callable[..., Awaitable[TestClient]],
) -> None:
from .app import create_app

Expand All @@ -27,7 +27,7 @@ async def test_turning_off_graphql_ws(


async def test_turning_off_graphql_transport_ws(
aiohttp_client: Callable[..., Awaitable[TestClient]]
aiohttp_client: Callable[..., Awaitable[TestClient]],
):
from .app import create_app

Expand All @@ -45,7 +45,7 @@ async def test_turning_off_graphql_transport_ws(


async def test_turning_off_all_ws_protocols(
aiohttp_client: Callable[..., Awaitable[TestClient]]
aiohttp_client: Callable[..., Awaitable[TestClient]],
):
from .app import create_app

Expand All @@ -72,7 +72,7 @@ async def test_turning_off_all_ws_protocols(


async def test_unsupported_ws_protocol(
aiohttp_client: Callable[..., Awaitable[TestClient]]
aiohttp_client: Callable[..., Awaitable[TestClient]],
):
from .app import create_app

Expand All @@ -90,7 +90,7 @@ async def test_unsupported_ws_protocol(


async def test_clients_can_prefer_protocols(
aiohttp_client: Callable[..., Awaitable[TestClient]]
aiohttp_client: Callable[..., Awaitable[TestClient]],
):
from .app import create_app

Expand Down
2 changes: 1 addition & 1 deletion tests/http/test_graphql_ide.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async def test_renders_graphiql_disabled(http_client_class: Type[HttpClient]):


async def test_renders_graphiql_disabled_deprecated(
http_client_class: Type[HttpClient]
http_client_class: Type[HttpClient],
):
with pytest.deprecated_call(
match=r"The `graphiql` argument is deprecated in favor of `graphql_ide`"
Expand Down
10 changes: 5 additions & 5 deletions tests/schema/extensions/test_sentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ async def test_sentry_tracer(

@pytest.mark.asyncio
async def test_uses_operation_name(
sentry_extension: Tuple[SentryTracingExtension, MagicMock]
sentry_extension: Tuple[SentryTracingExtension, MagicMock],
):
extension, mock = sentry_extension

Expand All @@ -189,7 +189,7 @@ async def test_uses_operation_name(

@pytest.mark.asyncio
async def test_uses_operation_type(
sentry_extension: Tuple[SentryTracingExtension, MagicMock]
sentry_extension: Tuple[SentryTracingExtension, MagicMock],
):
extension, mock = sentry_extension

Expand All @@ -213,7 +213,7 @@ async def test_uses_operation_type(

@pytest.mark.asyncio
async def test_uses_operation_subscription(
sentry_extension: Tuple[SentryTracingExtension, MagicMock]
sentry_extension: Tuple[SentryTracingExtension, MagicMock],
):
extension, mock = sentry_extension

Expand Down Expand Up @@ -321,7 +321,7 @@ def test_sentry_tracer_sync(


def test_uses_operation_name_sync(
sentry_extension_sync: Tuple[SentryTracingExtensionSync, MagicMock]
sentry_extension_sync: Tuple[SentryTracingExtensionSync, MagicMock],
):
extension, mock = sentry_extension_sync

Expand All @@ -346,7 +346,7 @@ def test_uses_operation_name_sync(


def test_uses_operation_type_sync(
sentry_extension_sync: Tuple[SentryTracingExtensionSync, MagicMock]
sentry_extension_sync: Tuple[SentryTracingExtensionSync, MagicMock],
):
extension, mock = sentry_extension_sync

Expand Down

0 comments on commit 6123d62

Please sign in to comment.