Skip to content

Commit b136f51

Browse files
authored
Upgrade ruff version and rules (#629)
1 parent 3b9b86e commit b136f51

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.9.6
3+
rev: v0.12.2
44
hooks:
55
- id: ruff
6-
args: [--fix, --exit-non-zero-on-fix]
76
- repo: https://github.com/pre-commit/pre-commit-hooks
87
rev: v4.5.0
98
hooks:

pyproject.toml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,13 @@ ignore = [
9191
"UP019",
9292
"UP035",
9393
"UP038",
94+
"UP045", # X | None instead of Optional[X]
9495
# Not relevant here
95-
"RUF012",
96-
"RUF022",
97-
"RUF023",
96+
"RUF012", # Use ClassVar for mutables
97+
"RUF022", # Unsorted __all__
98+
"RUF023", # Unsorted __slots__
99+
"B903", # Use dataclass / namedtuple
100+
"RUF031", # parentheses for tuples in subscripts
98101
# Ruff doesn't understand the globals() assignment; we test __all__
99102
# directly in test_all_names_in___all__.
100103
"F822",
@@ -109,6 +112,9 @@ ignore = [
109112
"E306",
110113
"E501",
111114
"E701",
115+
# Harmful for tests if applied.
116+
"RUF036", # None not at end of Union
117+
"RUF041", # nested Literal
112118
]
113119

114120
[tool.ruff.lint.isort]

0 commit comments

Comments
 (0)