From 543e656f011b647a28f2e150aed2a79893fea824 Mon Sep 17 00:00:00 2001 From: Anton Agestam Date: Sun, 20 Oct 2024 12:57:07 +0200 Subject: [PATCH] chore: Isolate ruff settings --- pyproject.toml | 56 -------------------------------------------------- ruff.toml | 50 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 56 deletions(-) create mode 100644 ruff.toml diff --git a/pyproject.toml b/pyproject.toml index 4f17814..a259859 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -107,59 +107,3 @@ markers = [ "external: mark tests that require extra dependencies", "no_external: mark tests that will fail if run with extra dependencies", ] - -[tool.ruff] -fix = true -target-version = "py39" -extend-select = [ - # bugbear - "B", - # comprehensions - "C4", - # mccabe - "C90", - # bandit - "S", - # blind exception - # Bare excepts are caught without this, but this also catches `except Exception: ...`. - "BLE", - # builtins - "A", - # Enforce valid noqa comments. - "RUF100", - # isort - "I", - # pycodestyle - "W", - # pyupgrade - "UP", - # debugger - "T10", - # print - "T20", - # quotes - "Q", - # return - # This gives 3 false positives, would be nice otherwise probably. - # "RET", - # simplify - "SIM", - # tidy imports - # We use this to only outlaw relative parent imports. - "TID", -] -extend-ignore = [ - # There's no reason to outlaw asserts. - # https://stackoverflow.com/a/68429294/1220706 - "S101", -] - -[tool.ruff.isort] -force-single-line = true -known-first-party = ["phantom", "tests"] - -[tool.ruff.mccabe] -max-complexity = 10 - -[tool.ruff.flake8-tidy-imports] -ban-relative-imports = "parents" diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..5bfb934 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,50 @@ +fix = true +target-version = "py39" + +[lint] +extend-select = [ + # bugbear + "B", + # comprehensions + "C4", + # mccabe + "C90", + # bandit + "S", + # blind exception + # Bare excepts are caught without this, but this also catches `except Exception: ...`. + "BLE", + # builtins + "A", + # Enforce valid noqa comments. + "RUF100", + # isort + "I", + # pycodestyle + "W", + # pyupgrade + "UP", + # debugger + "T10", + # print + "T20", + # quotes + "Q", + # return + # This gives 3 false positives, would be nice otherwise probably. + # "RET", + # simplify + "SIM", + # tidy imports + # We use this to only outlaw relative parent imports. + "TID", +] +extend-ignore = [ + # There's no reason to outlaw asserts. + # https://stackoverflow.com/a/68429294/1220706 + "S101", +] +isort.force-single-line = true +isort.known-first-party = ["phantom", "tests"] +flake8-tidy-imports.ban-relative-imports = "parents" +mccabe.max-complexity = 10