Skip to content

chore(deps): update ruff to 0.12.0 #3926

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

Merged
merged 2 commits into from
Jul 15, 2025
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
2 changes: 1 addition & 1 deletion .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.11.13
rev: v0.12.3
hooks:
- id: ruff-format
exclude: ^tests/\w+/snapshots/
Expand Down
40 changes: 20 additions & 20 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ packages = [{ include = "strawberry" }]
include = ["strawberry/py.typed"]

[tool.poetry.group.dev.dependencies]
ruff = "^0.11.4"
ruff = "^0.12.3"
asgiref = "^3.2"
email-validator = { version = ">=1.1.3,<3.0.0", optional = false }
freezegun = "^1.2.1"
Expand Down Expand Up @@ -220,6 +220,7 @@ ignore = [
# after we drop support for Python 3.9
"UP006",
"UP007",
"UP045",

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

# Allow imports inside functions
"PLC0415",

# ruff formatter recommends to disable those, as they conflict with it
# we don't need to ever enable those.
"COM812",
Expand All @@ -324,6 +328,7 @@ ignore = [
"Q003",
"W191",
]
exclude = ["tests/python_312/*"] # SyntaxError because we support Python 3.9+

[tool.ruff.lint.per-file-ignores]
".github/*" = ["INP001"]
Expand Down
12 changes: 6 additions & 6 deletions strawberry/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
try:
from .app import app
from .commands.codegen import codegen as codegen # noqa: PLC0414
from .commands.export_schema import export_schema as export_schema # noqa: PLC0414
from .commands.codegen import codegen as codegen
from .commands.export_schema import export_schema as export_schema
from .commands.locate_definition import (
locate_definition as locate_definition, # noqa: PLC0414
locate_definition as locate_definition,
)
from .commands.schema_codegen import (
schema_codegen as schema_codegen, # noqa: PLC0414
schema_codegen as schema_codegen,
)
from .commands.server import server as server # noqa: PLC0414
from .commands.upgrade import upgrade as upgrade # noqa: PLC0414
from .commands.server import server as server
from .commands.upgrade import upgrade as upgrade

def run() -> None:
app()
Expand Down
2 changes: 1 addition & 1 deletion tests/federation/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ class ProductFed:
price: Optional[int]
weight: Optional[int]

with pytest.warns(UserWarning) as record:
with pytest.warns(UserWarning) as record: # noqa: PT030
strawberry.Schema(
query=ProductFed,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/tools/test_merge_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,5 @@ def test_schema():

def test_fields_override():
"""It should warn when merging results in overriding fields"""
with pytest.warns(Warning):
with pytest.warns(Warning): # noqa: PT030
merge_types("FieldsOverride", (ComplexGreeter, SimpleGreeter))
2 changes: 1 addition & 1 deletion tests/types/test_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_annotation_hash(type1: Union[object, str], type2: Union[object, str]):


def test_eq_on_other_type():
class Foo:
class Foo: # noqa: PLW1641
def __eq__(self, other):
# Anything that is a strawberry annotation is equal to Foo
return isinstance(other, StrawberryAnnotation)
Expand Down
8 changes: 4 additions & 4 deletions tests/types/test_argument_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ def get_info(info) -> bool:
_ = info
return True

assert not get_info.arguments # Should have no arguments matched
assert not get_info.arguments # Should have no arguments matched

info_parameter = get_info.base_resolver.info_parameter
assert info_parameter is not None
assert info_parameter.name == "info"
info_parameter = get_info.base_resolver.info_parameter
assert info_parameter is not None
assert info_parameter.name == "info"
Loading