Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #443

Merged
merged 2 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repos:
- id: check-xml
- id: check-symlinks
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.7
rev: v0.1.8
hooks:
- id: ruff-format
- id: ruff
Expand All @@ -30,7 +30,7 @@ repos:
- id: alex
exclude: CHANGELOG.md
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.4
rev: v4.0.0-alpha.7
hooks:
- id: prettier
files: ^docs/.*\.mdx?$
10 changes: 5 additions & 5 deletions strawberry_django/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,11 +719,11 @@ def optimize(
return qs


optimizer: contextvars.ContextVar[
DjangoOptimizerExtension | None
] = contextvars.ContextVar(
"optimizer_ctx",
default=None,
optimizer: contextvars.ContextVar[DjangoOptimizerExtension | None] = (
contextvars.ContextVar(
"optimizer_ctx",
default=None,
)
)


Expand Down
6 changes: 3 additions & 3 deletions strawberry_django/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,9 +628,9 @@ class HasPerm(DjangoPermissionExtension):
"""

DEFAULT_TARGET: ClassVar[PermTarget] = PermTarget.GLOBAL
DEFAULT_ERROR_MESSAGE: ClassVar[
str
] = "You don't have permission to access this app."
DEFAULT_ERROR_MESSAGE: ClassVar[str] = (
"You don't have permission to access this app."
)
SCHEMA_DIRECTIVE_DESCRIPTION: ClassVar[Optional[str]] = _desc(
"Will check if the user has any/all permissions to resolve this.",
)
Expand Down
34 changes: 17 additions & 17 deletions tests/projects/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ class IssueType(relay.Node):
name_with_kind: str = strawberry_django.field(only=["kind", "name"])
tags: List["TagType"]
issue_assignees: List["AssigneeType"]
favorite_set: ListConnectionWithTotalCount[
"FavoriteType"
] = strawberry_django.connection()
favorite_set: ListConnectionWithTotalCount["FavoriteType"] = (
strawberry_django.connection()
)


@strawberry_django.type(Tag)
Expand Down Expand Up @@ -318,18 +318,18 @@ class Query:
project_list: List[ProjectType] = strawberry_django.field()
tag_list: List[TagType] = strawberry_django.field()

favorite_conn: ListConnectionWithTotalCount[
FavoriteType
] = strawberry_django.connection()
favorite_conn: ListConnectionWithTotalCount[FavoriteType] = (
strawberry_django.connection()
)
issue_conn: ListConnectionWithTotalCount[
strawberry.LazyType[
"IssueType",
"tests.projects.schema", # type: ignore # noqa: F821
]
] = strawberry_django.connection()
milestone_conn: ListConnectionWithTotalCount[
MilestoneType
] = strawberry_django.connection()
milestone_conn: ListConnectionWithTotalCount[MilestoneType] = (
strawberry_django.connection()
)

project_conn: ProjectConnection = strawberry_django.connection()
tag_conn: ListConnectionWithTotalCount[TagType] = strawberry_django.connection()
Expand Down Expand Up @@ -364,10 +364,10 @@ class Query:
issue_list_perm_required: List[IssueType] = strawberry_django.field(
extensions=[HasPerm(perms=["projects.view_issue"])],
)
issue_conn_perm_required: ListConnectionWithTotalCount[
IssueType
] = strawberry_django.connection(
extensions=[HasPerm(perms=["projects.view_issue"])],
issue_conn_perm_required: ListConnectionWithTotalCount[IssueType] = (
strawberry_django.connection(
extensions=[HasPerm(perms=["projects.view_issue"])],
)
)
# User permission on the resolved object for "projects.view_issue"
issue_obj_perm_required: IssueType = strawberry_django.node(
Expand All @@ -379,10 +379,10 @@ class Query:
issue_list_obj_perm_required: List[IssueType] = strawberry_django.field(
extensions=[HasRetvalPerm(perms=["projects.view_issue"])],
)
issue_conn_obj_perm_required: ListConnectionWithTotalCount[
IssueType
] = strawberry_django.connection(
extensions=[HasRetvalPerm(perms=["projects.view_issue"])],
issue_conn_obj_perm_required: ListConnectionWithTotalCount[IssueType] = (
strawberry_django.connection(
extensions=[HasRetvalPerm(perms=["projects.view_issue"])],
)
)

@strawberry_django.field(
Expand Down
10 changes: 5 additions & 5 deletions tests/relay/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ class Query:
fruits_lazy: ListConnectionWithTotalCount[
Annotated["Fruit", strawberry.lazy("tests.relay.schema")]
] = strawberry_django.connection()
fruits_with_filters_and_order: ListConnectionWithTotalCount[
Fruit
] = strawberry_django.connection(
filters=FruitFilter,
order=FruitOrder,
fruits_with_filters_and_order: ListConnectionWithTotalCount[Fruit] = (
strawberry_django.connection(
filters=FruitFilter,
order=FruitOrder,
)
)

@strawberry_django.connection(ListConnectionWithTotalCount[Fruit])
Expand Down
Loading