Skip to content

Commit 79214e6

Browse files
authored
chore(deps): update ruff to 0.12.0 (#3926)
1 parent dc43880 commit 79214e6

File tree

8 files changed

+40
-35
lines changed

8 files changed

+40
-35
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.11.13
3+
rev: v0.12.3
44
hooks:
55
- id: ruff-format
66
exclude: ^tests/\w+/snapshots/

poetry.lock

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ packages = [{ include = "strawberry" }]
6767
include = ["strawberry/py.typed"]
6868

6969
[tool.poetry.group.dev.dependencies]
70-
ruff = "^0.11.4"
70+
ruff = "^0.12.3"
7171
asgiref = "^3.2"
7272
email-validator = { version = ">=1.1.3,<3.0.0", optional = false }
7373
freezegun = "^1.2.1"
@@ -220,6 +220,7 @@ ignore = [
220220
# after we drop support for Python 3.9
221221
"UP006",
222222
"UP007",
223+
"UP045",
223224

224225
# we use asserts in tests and to hint mypy
225226
"S101",
@@ -308,6 +309,9 @@ ignore = [
308309
# Don't force if branches to be converted to "or"
309310
"SIM114",
310311

312+
# Allow imports inside functions
313+
"PLC0415",
314+
311315
# ruff formatter recommends to disable those, as they conflict with it
312316
# we don't need to ever enable those.
313317
"COM812",
@@ -324,6 +328,7 @@ ignore = [
324328
"Q003",
325329
"W191",
326330
]
331+
exclude = ["tests/python_312/*"] # SyntaxError because we support Python 3.9+
327332

328333
[tool.ruff.lint.per-file-ignores]
329334
".github/*" = ["INP001"]

strawberry/cli/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
try:
22
from .app import app
3-
from .commands.codegen import codegen as codegen # noqa: PLC0414
4-
from .commands.export_schema import export_schema as export_schema # noqa: PLC0414
3+
from .commands.codegen import codegen as codegen
4+
from .commands.export_schema import export_schema as export_schema
55
from .commands.locate_definition import (
6-
locate_definition as locate_definition, # noqa: PLC0414
6+
locate_definition as locate_definition,
77
)
88
from .commands.schema_codegen import (
9-
schema_codegen as schema_codegen, # noqa: PLC0414
9+
schema_codegen as schema_codegen,
1010
)
11-
from .commands.server import server as server # noqa: PLC0414
12-
from .commands.upgrade import upgrade as upgrade # noqa: PLC0414
11+
from .commands.server import server as server
12+
from .commands.upgrade import upgrade as upgrade
1313

1414
def run() -> None:
1515
app()

tests/federation/test_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ class ProductFed:
329329
price: Optional[int]
330330
weight: Optional[int]
331331

332-
with pytest.warns(UserWarning) as record:
332+
with pytest.warns(UserWarning) as record: # noqa: PT030
333333
strawberry.Schema(
334334
query=ProductFed,
335335
)

tests/tools/test_merge_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,5 @@ def test_schema():
8686

8787
def test_fields_override():
8888
"""It should warn when merging results in overriding fields"""
89-
with pytest.warns(Warning):
89+
with pytest.warns(Warning): # noqa: PT030
9090
merge_types("FieldsOverride", (ComplexGreeter, SimpleGreeter))

tests/types/test_annotation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def test_annotation_hash(type1: Union[object, str], type2: Union[object, str]):
5050

5151

5252
def test_eq_on_other_type():
53-
class Foo:
53+
class Foo: # noqa: PLW1641
5454
def __eq__(self, other):
5555
# Anything that is a strawberry annotation is equal to Foo
5656
return isinstance(other, StrawberryAnnotation)

tests/types/test_argument_types.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ def get_info(info) -> bool:
141141
_ = info
142142
return True
143143

144-
assert not get_info.arguments # Should have no arguments matched
144+
assert not get_info.arguments # Should have no arguments matched
145145

146-
info_parameter = get_info.base_resolver.info_parameter
147-
assert info_parameter is not None
148-
assert info_parameter.name == "info"
146+
info_parameter = get_info.base_resolver.info_parameter
147+
assert info_parameter is not None
148+
assert info_parameter.name == "info"

0 commit comments

Comments
 (0)