Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Ruff deprecations #267

Merged
merged 3 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions scripts/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
16 changes: 9 additions & 7 deletions {{cookiecutter.project_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"]
Expand Down
Loading