Skip to content

Commit fd0e508

Browse files
Update pre-commit to use ruff
1 parent b852140 commit fd0e508

File tree

2 files changed

+37
-13
lines changed

2 files changed

+37
-13
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ repos:
1111
args: [--branch, main]
1212
- id: trailing-whitespace
1313

14-
- repo: https://github.com/asottile/pyupgrade
15-
rev: v3.16.0
16-
hooks:
17-
- id: pyupgrade
18-
args: [--py310-plus]
19-
2014
- repo: https://github.com/astral-sh/ruff-pre-commit
2115
rev: v0.4.8
2216
hooks:

pyproject.toml

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,50 @@ filterwarnings =[
2222
'ignore:jax\.tree_map is deprecated:DeprecationWarning',
2323
]
2424

25-
[tool.black]
26-
line-length = 100
27-
2825
[tool.coverage.report]
2926
exclude_lines = [
3027
"pragma: nocover",
3128
"raise NotImplementedError",
3229
"if TYPE_CHECKING:",
3330
]
3431

35-
[tool.nbqa.mutate]
36-
isort = 1
37-
black = 1
38-
pyupgrade = 1
32+
[tool.ruff]
33+
line-length = 100
34+
target-version = "py310"
35+
36+
[tool.ruff.lint]
37+
select = ["D", "E", "F", "I", "UP", "W", "RUF"]
38+
ignore = [
39+
"E501",
40+
"RUF001", # String contains ambiguous character (such as Greek letters)
41+
"RUF002", # Docstring contains ambiguous character (such as Greek letters)
42+
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
43+
"D100",
44+
"D101",
45+
"D102",
46+
"D103",
47+
"D104",
48+
"D105",
49+
"D107",
50+
"D200",
51+
"D202",
52+
"D203",
53+
"D204",
54+
"D205",
55+
"D209",
56+
"D212",
57+
"D213",
58+
"D301",
59+
"D400",
60+
"D401",
61+
"D403",
62+
"D413",
63+
"D415",
64+
"D417",
65+
]
66+
67+
[tool.ruff.lint.isort]
68+
lines-between-types = 1
3969

4070
[tool.ruff.lint.per-file-ignores]
4171
'tests/*.py' = ['F841'] # Disable unused variable warning for test files

0 commit comments

Comments
 (0)