Skip to content

Commit 7898766

Browse files
committed
Update ruff
1 parent 3b9c498 commit 7898766

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repos:
2020
hooks:
2121
- id: black
2222
- repo: https://github.com/astral-sh/ruff-pre-commit
23-
rev: v0.0.282
23+
rev: v0.0.283
2424
hooks:
2525
- id: ruff
2626
args: [--fix, --exit-non-zero-on-fix, --show-fixes]

graphene_django/forms/converter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ def get_form_field_description(field):
2727
@singledispatch
2828
def convert_form_field(field):
2929
raise ImproperlyConfigured(
30-
"Don't know how to convert the Django form field {} ({}) "
31-
"to Graphene type".format(field, field.__class__)
30+
f"Don't know how to convert the Django form field {field} ({field.__class__}) "
31+
"to Graphene type"
3232
)
3333

3434

graphene_django/rest_framework/serializer_converter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
@singledispatch
1414
def get_graphene_type_from_serializer_field(field):
1515
raise ImproperlyConfigured(
16-
"Don't know how to convert the serializer field {} ({}) "
17-
"to Graphene type".format(field, field.__class__)
16+
f"Don't know how to convert the serializer field {field} ({field.__class__}) "
17+
"to Graphene type"
1818
)
1919

2020

graphene_django/types.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ def __init_subclass_with_meta__(
160160
registry = get_global_registry()
161161

162162
assert isinstance(registry, Registry), (
163-
"The attribute registry in {} needs to be an instance of "
164-
'Registry, received "{}".'
165-
).format(cls.__name__, registry)
163+
f"The attribute registry in {cls.__name__} needs to be an instance of "
164+
f'Registry, received "{registry}".'
165+
)
166166

167167
if filter_fields and filterset_class:
168168
raise Exception("Can't set both filter_fields and filterset_class")
@@ -175,7 +175,7 @@ def __init_subclass_with_meta__(
175175

176176
assert not (fields and exclude), (
177177
"Cannot set both 'fields' and 'exclude' options on "
178-
"DjangoObjectType {class_name}.".format(class_name=cls.__name__)
178+
f"DjangoObjectType {cls.__name__}."
179179
)
180180

181181
# Alias only_fields -> fields
@@ -214,8 +214,8 @@ def __init_subclass_with_meta__(
214214
warnings.warn(
215215
"Creating a DjangoObjectType without either the `fields` "
216216
"or the `exclude` option is deprecated. Add an explicit `fields "
217-
"= '__all__'` option on DjangoObjectType {class_name} to use all "
218-
"fields".format(class_name=cls.__name__),
217+
f"= '__all__'` option on DjangoObjectType {cls.__name__} to use all "
218+
"fields",
219219
DeprecationWarning,
220220
stacklevel=2,
221221
)

0 commit comments

Comments
 (0)