From b44d6122c4d348ae0cb6c0192a9e57b5f3939f2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Deltheil?= Date: Mon, 11 Dec 2023 11:40:27 +0100 Subject: [PATCH] pyproject.toml: enable isort rule in Ruff Use `combine-as-imports = true` [1] to avoid such kinds or imports on a single line: from torch import Tensor, device as Device, dtype as DType [1]: https://docs.astral.sh/ruff/settings/#isort-combine-as-imports --- pyproject.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 02ca4e9..4f5652a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,12 +68,19 @@ lint = { chain = ["ruff format .", "ruff --fix ."] } line-length = 120 [tool.ruff] +src = ["src"] # see https://docs.astral.sh/ruff/settings/#src +select = [ + "I", # isort +] ignore = [ "F722", # forward-annotation-syntax-error, because of Jaxtyping "E731", # do-not-assign-lambda ] line-length = 120 +[tool.ruff.lint.isort] +combine-as-imports = true + [tool.docformatter] black = true