Skip to content

Commit

Permalink
Update ruff configuration to fix deprecation warnings. (#39)
Browse files Browse the repository at this point in the history
ruff has deprecated top-level lint settings, instead they must be moved
into a dedicated `lint` section. Additionally, the CLI now needs to be
invoked with a `check` subcommand.

https://astral.sh/blog/ruff-v0.2.0#configuration-changes
astral-sh/ruff#10169
  • Loading branch information
plietar authored Apr 9, 2024
1 parent 5f927d6 commit ccd9c2b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ extra-dependencies = [
[tool.hatch.envs.lint.scripts]
typing = "mypy --install-types --non-interactive {args:src tests}"
style = [
"ruff {args:.}",
"ruff check {args:.}",
"black --check --diff {args:.}",
]
fmt = [
"black {args:.}",
"ruff --fix {args:.}",
"ruff check --fix {args:.}",
"style",
]
all = [
Expand All @@ -112,6 +112,8 @@ skip-string-normalization = true
[tool.ruff]
target-version = "py37"
line-length = 120

[tool.ruff.lint]
select = [
"A",
"ARG",
Expand Down Expand Up @@ -161,17 +163,17 @@ unfixable = [
"F401",
]

[tool.ruff.isort]
[tool.ruff.lint.isort]
known-first-party = ["outpack"]

[tool.ruff.flake8-tidy-imports]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"tests/**/*" = ["PLR2004", "S101", "TID252"]

[tool.ruff.pydocstyle]
[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.coverage.run]
Expand Down

0 comments on commit ccd9c2b

Please sign in to comment.