Skip to content

Commit a76f302

Browse files
committed
Update ruff.toml and pre-commit
1 parent 32f31b7 commit a76f302

File tree

3 files changed

+24
-16
lines changed

3 files changed

+24
-16
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repos:
1919
- id: python-check-blanket-noqa
2020

2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.11.9
22+
rev: v0.11.10
2323
hooks:
2424
- id: ruff
2525
args:
@@ -47,6 +47,6 @@ repos:
4747
- MD013
4848

4949
- repo: https://github.com/astral-sh/uv-pre-commit
50-
rev: 0.7.3
50+
rev: 0.7.5
5151
hooks:
5252
- id: uv-lock

ruff.toml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ select = [
3838
"RSE", # flake8-raise
3939
"RET", # flake8-return
4040
"SIM", # flake8-simplify
41-
"TCH", # flake8-type-checking
41+
"TC", # flake8-type-checking
4242
"ARG", # flake8-unused-arguments
4343
"PTH", # flake8-use-pathlib
4444
"ERA", # flake8-eradicate
@@ -47,12 +47,12 @@ select = [
4747
"PGH", # pygrep-hooks
4848
"PL", # pylint
4949
"PLC0414", # Import alias does not rename original package
50-
"PLE", # Error
51-
"PLW", # Warning
5250
"TRY", # tryceratops
5351
"FLY", # flynt
5452
"PERF", # Perflint
5553
"RUF", # ruff-specific rules
54+
"DTZ", # flake8-datetimez
55+
"FURB", # Refurb # TODO: Try integrating this one back but ignore some of the rules
5656

5757
# Framework-specific
5858
"DJ", # flake8-django
@@ -93,11 +93,12 @@ ignore = [
9393
"COM819", # Checks for the presence of prohibited trailing commas
9494
"ISC001", # Checks for implicitly concatenated strings on a single line
9595
"ISC002", # Checks for implicitly concatenated strings that span multiple lines
96-
"FURB", # Refurb # TODO: Try integrating this one back but ignore some of the rules
97-
"PL", # pylint
98-
"TD", # flake8-todos
99-
"DOC", # pydocstyle
100-
"RUF029",
96+
97+
# Framework-specific
98+
99+
"PL", # pylint
100+
"TD", # flake8-todos
101+
"DOC", # pydocstyle
101102

102103
### The other rules ###
103104
"D203", # 1 blank line required before class docstring
@@ -107,11 +108,18 @@ ignore = [
107108
"TRY300", # Consider moving statement into the else clause
108109
"PT019", # Fixture without value is injected as parameter, use @pytest.mark.usefixtures instead
109110
# (usefixtures doesn't play well with IDE features such as auto-renaming)
110-
"SIM108", # Use ternary operator instead of if-else block (ternaries lie to coverage)
111-
"RET505", # Unnecessary `else` after `return` statement
112-
"N805", # First argument of a method should be named `self` (pydantic validators don't play well with this)
113-
"UP007", # Use `X | Y` for type annotations (we need this for testing and our runtime logic)
114-
"RET506", # Unnecessary `elif` after `raise` statement
111+
"SIM108", # Use ternary operator instead of if-else block (ternaries lie to coverage)
112+
"RET505", # Unnecessary `else` after `return` statement
113+
"N805", # First argument of a method should be named `self` (pydantic validators don't play well with this)
114+
"UP007", # Use `X | Y` for type annotations (we need this for testing and our runtime logic)
115+
"RET506", # Unnecessary `elif` after `raise` statement
116+
"FURB101", # Refurb: open and read should be replaced by Path({filename}).{suggestion}
117+
"FURB103", # Refurb: open and write should be replaced by Path({filename}).{suggestion}
118+
"FURB113", # Refurb: Use extend instead of repeatedly calling list.append()
119+
"FURB118", # Use operator.* alternative instead of defining a function
120+
"FURB140", # Use itertools.starmap instead of the generator
121+
"FURB148", # enumerate value is unused, use for x in range(len(y)) instead
122+
"FURB162", # Unnecessary timezone replacement with zero offset. TODO: Remove this when we drop support for python 3.10
115123
]
116124

117125

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def serialize_object(obj: Any):
184184
modified_list = []
185185
for v in obj:
186186
if callable(v):
187-
v = v.__name__ # noqa: PLW2901
187+
v = v.__name__
188188
modified_list.append(serialize_object(v))
189189
return modified_list
190190
else:

0 commit comments

Comments
 (0)