Skip to content

Commit

Permalink
Update Ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Jan 24, 2025
1 parent 7cbc77f commit c17b1f3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.9.3
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand All @@ -17,7 +17,7 @@ repos:
args: [tests]

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
rev: v2.4.0
hooks:
- id: codespell
args: [--exclude-file=tests/test_mypy.yml]
Expand Down
2 changes: 1 addition & 1 deletion src/attr/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -2285,7 +2285,7 @@ def _attrs_to_init_script(
NL = "\n "
return (
f"""def {method_name}(self, {args}):
{NL.join(lines) if lines else 'pass'}
{NL.join(lines) if lines else "pass"}
""",
names_for_globals,
annotations,
Expand Down
7 changes: 4 additions & 3 deletions tests/test_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import pytest

import attr
import attrs

from attr._compat import PY_3_14_PLUS
from attr._make import _is_class_var
Expand Down Expand Up @@ -107,7 +108,7 @@ def test_auto_attribs(self, slots):
class C:
cls_var: typing.ClassVar[int] = 23
a: int
x: typing.List[int] = attr.Factory(list)
x: typing.List[int] = attrs.Factory(list)
y: int = 2
z: int = attr.ib(default=3)
foo: typing.Any = None
Expand Down Expand Up @@ -407,7 +408,7 @@ class C:
cls_var2: "ClassVar[int]" = 23
cls_var3: "t.ClassVar[int]" = 23
a: "int"
x: "typing.List[int]" = attr.Factory(list)
x: "typing.List[int]" = attrs.Factory(list)
y: "int" = 2
z: "int" = attr.ib(default=3)
foo: "typing.Any" = None
Expand Down Expand Up @@ -500,7 +501,7 @@ def __eq__(self, other):

@attr.s(auto_attribs=True)
class C:
x: typing.Any = NonComparable()
x: typing.Any = NonComparable() # noqa: RUF009

def test_basic_resolve(self):
"""
Expand Down
3 changes: 1 addition & 2 deletions tests/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -1074,8 +1074,7 @@ def test_repr(self):
v = not_(wrapped)

assert (
f"<not_ validator wrapping {wrapped!r}, "
f"capturing {v.exc_types!r}>"
f"<not_ validator wrapping {wrapped!r}, capturing {v.exc_types!r}>"
) == repr(v)

def test_success_because_fails(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/typing_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class Validated2:

@attrs.define
class Validated3:
num: int = attr.field(validator=attr.validators.ge(0))
num: int = attrs.field(validator=attrs.validators.ge(0))


with attr.validators.disabled():
Expand Down

0 comments on commit c17b1f3

Please sign in to comment.