Skip to content

Commit 2f1014a

Browse files
committed
Black dropped us 5 years ago
psf/black@31f4105
1 parent 62fb657 commit 2f1014a

15 files changed

+12
-25
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ You will find the built documentation in `docs/_build/html`.
109109

110110
## Code
111111

112-
- We follow [PEP 8](https://peps.python.org/pep-0008/) as enforced by [Ruff](https://ruff.rs/) and [Black](https://github.com/psf/black) with a line length of 79 characters.
112+
- We follow [PEP 8](https://peps.python.org/pep-0008/) as enforced by [Ruff](https://ruff.rs/) with a line length of 79 characters.
113113

114114
- As long as you run our full *tox* suite before committing, or install our [*pre-commit*](https://pre-commit.com/) hooks, you won't have to spend any time on formatting your code at all.
115115
If you don't, CI will catch it for you -- but that seems like a waste of your time!

.pre-commit-config.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@ ci:
33
autoupdate_schedule: monthly
44

55
repos:
6-
- repo: https://github.com/psf/black
7-
rev: 24.8.0
8-
hooks:
9-
- id: black
10-
116
- repo: https://github.com/astral-sh/ruff-pre-commit
127
rev: v0.6.3
138
hooks:
9+
- id: ruff-format
1410
- id: ruff
1511
args: [--fix, --exit-non-zero-on-fix]
1612

pyproject.toml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,6 @@ exclude_lines = [
173173
]
174174

175175

176-
[tool.black]
177-
line-length = 79
178-
179-
180176
[tool.interrogate]
181177
omit-covered-files = true
182178
verbose = 2
@@ -190,6 +186,7 @@ toplevel = ["attr", "attrs"]
190186

191187
[tool.ruff]
192188
src = ["src", "tests", "conftest.py", "docs"]
189+
line-length = 79
193190

194191
[tool.ruff.lint]
195192
select = ["ALL"]
@@ -200,12 +197,13 @@ ignore = [
200197
"ANN", # Mypy is better at this
201198
"ARG", # unused arguments are normal when implementing interfaces
202199
"C901", # we're complex software
203-
"COM", # Black takes care of our commas
200+
"COM", # ruff format takes care of our commas
204201
"D", # We prefer our own docstring style.
205-
"E501", # leave line-length enforcement to Black
202+
"E501", # leave line-length enforcement to ruff format
206203
"ERA001", # we need to keep around some notes
207204
"FBT", # we don't hate bool args around here
208205
"FIX", # Yes, we want XXX as a marker.
206+
"ISC001", # conflicts with ruff format
209207
"N", # we need more naming freedom
210208
"PD", # we're not pandas
211209
"PLR0912", # we're complex software

src/attr/_next_gen.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
default values.
66
"""
77

8-
98
from functools import partial
109

1110
from . import setters

src/attr/converters.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
Commonly useful converters.
55
"""
66

7-
87
import typing
98

109
from ._compat import _AnnotationExtractor

src/attr/validators.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
Commonly useful validators.
55
"""
66

7-
87
import operator
98
import re
109

src/attr/validators.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ def instance_of(type: type[_T]) -> _ValidatorType[_T]: ...
3636
def instance_of(type: tuple[type[_T]]) -> _ValidatorType[_T]: ...
3737
@overload
3838
def instance_of(
39-
type: tuple[type[_T1], type[_T2]]
39+
type: tuple[type[_T1], type[_T2]],
4040
) -> _ValidatorType[_T1 | _T2]: ...
4141
@overload
4242
def instance_of(
43-
type: tuple[type[_T1], type[_T2], type[_T3]]
43+
type: tuple[type[_T1], type[_T2], type[_T3]],
4444
) -> _ValidatorType[_T1 | _T2 | _T3]: ...
4545
@overload
4646
def instance_of(type: tuple[type, ...]) -> _ValidatorType[Any]: ...

tests/strategies.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44
Testing strategies for Hypothesis-based tests.
55
"""
6+
67
import functools
78
import keyword
89
import string

tests/test_config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
Tests for `attr._config`.
55
"""
66

7-
87
import pytest
98

109
from attr import _config

tests/test_dunders.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
Tests for dunder methods from `attrib._make`.
55
"""
66

7-
87
import copy
98
import inspect
109
import pickle
@@ -481,12 +480,12 @@ def test_enforces_type(self):
481480
exc_args = ("Invalid value for hash. Must be True, False, or None.",)
482481

483482
with pytest.raises(TypeError) as e:
484-
make_class("C", {}, unsafe_hash=1),
483+
make_class("C", {}, unsafe_hash=1)
485484

486485
assert exc_args == e.value.args
487486

488487
with pytest.raises(TypeError) as e:
489-
make_class("C", {"a": attr.ib(hash=1)}),
488+
make_class("C", {"a": attr.ib(hash=1)})
490489

491490
assert exc_args == e.value.args
492491

0 commit comments

Comments
 (0)