diff --git a/scripts/pyproject.toml b/scripts/pyproject.toml index 3e115d52..fe080f05 100644 --- a/scripts/pyproject.toml +++ b/scripts/pyproject.toml @@ -61,6 +61,11 @@ filterwarnings = ["error"] [tool.ruff] line-length = 120 + +[tool.ruff.format] +docstring-code-format = true + +[tool.ruff.lint] allowed-confusables = ["’", "×"] select = [ "A", @@ -96,13 +101,10 @@ ignore = [ ] unfixable = ["RUF001"] # never “fix” “confusables” -[tool.ruff.format] -docstring-code-format = true - -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["scverse_template_scripts"] -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "tests/*.py" = [ "ARG001", # pytest fixtures don’t need to be used "PLR0913", # allow as many pytest fixtures being used as one likes diff --git a/{{cookiecutter.project_name}}/pyproject.toml b/{{cookiecutter.project_name}}/pyproject.toml index 71ac7557..ff5f9f61 100644 --- a/{{cookiecutter.project_name}}/pyproject.toml +++ b/{{cookiecutter.project_name}}/pyproject.toml @@ -68,8 +68,14 @@ addopts = [ ] [tool.ruff] -src = ["src"] line-length = 120 +src = ["src"] +extend-include = ["*.ipynb"] + +[tool.ruff.format] +docstring-code-format = true + +[tool.ruff.lint] select = [ "F", # Errors detected by Pyflakes "E", # Error detected by Pycodestyle @@ -110,15 +116,11 @@ ignore = [ # We want docstrings to start immediately after the opening triple quote "D213", ] -extend-include = ["*.ipynb"] - -[tool.ruff.format] -docstring-code-format = true -[tool.ruff.pydocstyle] +[tool.ruff.lint.pydocstyle] convention = "numpy" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "docs/*" = ["I"] "tests/*" = ["D"] "*/__init__.py" = ["F401"]