Skip to content

Commit 4820ab8

Browse files
committed
Ruff: move config to pyproject.toml
Move config from ruff to `pyproject.toml` to fix some issues with VSCode and to reduce cluttering in the root.
1 parent 7d83063 commit 4820ab8

File tree

3 files changed

+25
-20
lines changed

3 files changed

+25
-20
lines changed

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@
107107
"zmax",
108108
"zmin"
109109
],
110-
"editor.formatOnType": true,
110+
"[python]": {
111+
"editor.defaultFormatter": "charliermarsh.ruff"
112+
},
111113
"esbonio.sphinx.confDir": "",
112114
// Don't update the settings.json file with values inferred from Meson (we provide them manually)
113115
"mesonbuild.modifySettings": false,

pyproject.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,25 @@ lint = [
175175
"pycodestyle",
176176
"flake8-rst-docstrings",
177177
]
178+
179+
[tool.ruff]
180+
# https://docs.astral.sh/ruff/configuration
181+
182+
# Python 3.11 is the minimum supported version
183+
target-version = "py311"
184+
185+
[tool.ruff.lint]
186+
select = [
187+
"E", # pycodestyle errors - https://docs.astral.sh/ruff/rules/#error-e
188+
"F", # pyflakes - https://docs.astral.sh/ruff/rules/#pyflakes-f
189+
"I", # isort - https://docs.astral.sh/ruff/rules/#isort-i
190+
"PL", # pylint - https://docs.astral.sh/ruff/rules/#pylint-pl
191+
]
192+
ignore = [
193+
"E501", # Line too long - hard to avoid in doctests, and better handled by black.
194+
]
195+
196+
[tool.ruff.lint.per-file-ignores]
197+
"all.py" = [
198+
"F401", # Unused import - these files are by definition collections of imports.
199+
]

ruff.toml

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)