Skip to content

Commit c17b1f3

Browse files
committed
Update Ruff
1 parent 7cbc77f commit c17b1f3

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ci:
44

55
repos:
66
- repo: https://github.com/astral-sh/ruff-pre-commit
7-
rev: v0.8.6
7+
rev: v0.9.3
88
hooks:
99
- id: ruff
1010
args: [--fix, --exit-non-zero-on-fix]
@@ -17,7 +17,7 @@ repos:
1717
args: [tests]
1818

1919
- repo: https://github.com/codespell-project/codespell
20-
rev: v2.3.0
20+
rev: v2.4.0
2121
hooks:
2222
- id: codespell
2323
args: [--exclude-file=tests/test_mypy.yml]

src/attr/_make.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2285,7 +2285,7 @@ def _attrs_to_init_script(
22852285
NL = "\n "
22862286
return (
22872287
f"""def {method_name}(self, {args}):
2288-
{NL.join(lines) if lines else 'pass'}
2288+
{NL.join(lines) if lines else "pass"}
22892289
""",
22902290
names_for_globals,
22912291
annotations,

tests/test_annotations.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import pytest
1212

1313
import attr
14+
import attrs
1415

1516
from attr._compat import PY_3_14_PLUS
1617
from attr._make import _is_class_var
@@ -107,7 +108,7 @@ def test_auto_attribs(self, slots):
107108
class C:
108109
cls_var: typing.ClassVar[int] = 23
109110
a: int
110-
x: typing.List[int] = attr.Factory(list)
111+
x: typing.List[int] = attrs.Factory(list)
111112
y: int = 2
112113
z: int = attr.ib(default=3)
113114
foo: typing.Any = None
@@ -407,7 +408,7 @@ class C:
407408
cls_var2: "ClassVar[int]" = 23
408409
cls_var3: "t.ClassVar[int]" = 23
409410
a: "int"
410-
x: "typing.List[int]" = attr.Factory(list)
411+
x: "typing.List[int]" = attrs.Factory(list)
411412
y: "int" = 2
412413
z: "int" = attr.ib(default=3)
413414
foo: "typing.Any" = None
@@ -500,7 +501,7 @@ def __eq__(self, other):
500501

501502
@attr.s(auto_attribs=True)
502503
class C:
503-
x: typing.Any = NonComparable()
504+
x: typing.Any = NonComparable() # noqa: RUF009
504505

505506
def test_basic_resolve(self):
506507
"""

tests/test_validators.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,8 +1074,7 @@ def test_repr(self):
10741074
v = not_(wrapped)
10751075

10761076
assert (
1077-
f"<not_ validator wrapping {wrapped!r}, "
1078-
f"capturing {v.exc_types!r}>"
1077+
f"<not_ validator wrapping {wrapped!r}, capturing {v.exc_types!r}>"
10791078
) == repr(v)
10801079

10811080
def test_success_because_fails(self):

tests/typing_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ class Validated2:
269269

270270
@attrs.define
271271
class Validated3:
272-
num: int = attr.field(validator=attr.validators.ge(0))
272+
num: int = attrs.field(validator=attrs.validators.ge(0))
273273

274274

275275
with attr.validators.disabled():

0 commit comments

Comments
 (0)