diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3c9fc9a4..29982617 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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?$ diff --git a/strawberry_django/optimizer.py b/strawberry_django/optimizer.py index c517fcd9..85ade6f2 100644 --- a/strawberry_django/optimizer.py +++ b/strawberry_django/optimizer.py @@ -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, + ) ) diff --git a/strawberry_django/permissions.py b/strawberry_django/permissions.py index 4c326e91..4bf35211 100644 --- a/strawberry_django/permissions.py +++ b/strawberry_django/permissions.py @@ -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.", ) diff --git a/tests/projects/schema.py b/tests/projects/schema.py index 3abee19b..d7795993 100644 --- a/tests/projects/schema.py +++ b/tests/projects/schema.py @@ -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) @@ -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() @@ -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( @@ -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( diff --git a/tests/relay/schema.py b/tests/relay/schema.py index 4423dc3e..f51c54bd 100644 --- a/tests/relay/schema.py +++ b/tests/relay/schema.py @@ -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])