Skip to content

Commit f0ce514

Browse files
authored
Fix Ruff deprecations (#267)
* Fix Ruff deprecations * fix in scripts directory too * move settings
1 parent 7cbc833 commit f0ce514

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

scripts/pyproject.toml

+7-5
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ filterwarnings = ["error"]
6161

6262
[tool.ruff]
6363
line-length = 120
64+
65+
[tool.ruff.format]
66+
docstring-code-format = true
67+
68+
[tool.ruff.lint]
6469
allowed-confusables = ["", "×"]
6570
select = [
6671
"A",
@@ -96,13 +101,10 @@ ignore = [
96101
]
97102
unfixable = ["RUF001"] # never “fix” “confusables”
98103

99-
[tool.ruff.format]
100-
docstring-code-format = true
101-
102-
[tool.ruff.isort]
104+
[tool.ruff.lint.isort]
103105
known-first-party = ["scverse_template_scripts"]
104106

105-
[tool.ruff.per-file-ignores]
107+
[tool.ruff.lint.per-file-ignores]
106108
"tests/*.py" = [
107109
"ARG001", # pytest fixtures don’t need to be used
108110
"PLR0913", # allow as many pytest fixtures being used as one likes

{{cookiecutter.project_name}}/pyproject.toml

+9-7
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,14 @@ addopts = [
6868
]
6969

7070
[tool.ruff]
71-
src = ["src"]
7271
line-length = 120
72+
src = ["src"]
73+
extend-include = ["*.ipynb"]
74+
75+
[tool.ruff.format]
76+
docstring-code-format = true
77+
78+
[tool.ruff.lint]
7379
select = [
7480
"F", # Errors detected by Pyflakes
7581
"E", # Error detected by Pycodestyle
@@ -110,15 +116,11 @@ ignore = [
110116
# We want docstrings to start immediately after the opening triple quote
111117
"D213",
112118
]
113-
extend-include = ["*.ipynb"]
114-
115-
[tool.ruff.format]
116-
docstring-code-format = true
117119

118-
[tool.ruff.pydocstyle]
120+
[tool.ruff.lint.pydocstyle]
119121
convention = "numpy"
120122

121-
[tool.ruff.per-file-ignores]
123+
[tool.ruff.lint.per-file-ignores]
122124
"docs/*" = ["I"]
123125
"tests/*" = ["D"]
124126
"*/__init__.py" = ["F401"]

0 commit comments

Comments
 (0)