From ccd9c2b7c78f8980f50727b815fc46e76ff39369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Li=C3=A9tar?= Date: Tue, 9 Apr 2024 13:56:30 +0100 Subject: [PATCH] Update ruff configuration to fix deprecation warnings. (#39) 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 https://github.com/astral-sh/ruff/pull/10169 --- pyproject.toml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7447bad2..e6822243 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [ @@ -112,6 +112,8 @@ skip-string-normalization = true [tool.ruff] target-version = "py37" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", @@ -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]