diff --git a/pyproject.toml b/pyproject.toml index 7894d904ca37..597019e2d7b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -144,82 +144,3 @@ build-backend = "poetry_dynamic_versioning.backend" [project] # This has to match the poetry python entry above requires-python = ">=3.9, <3.13" - -[tool.ruff] -line-length = 120 - -[tool.ruff.lint] -preview = true -select = [ - "PL", # Pylint - "I", # Isort - "FA", # Flake8: future-annotations - "UP", # Pyupgrade - # Flake8 core - "F", - "E", - "W", -] -explicit-preview-rules = false -ignore = [ - # Pylint convention - "PLC0105", # type-name-incorrect-variance - "PLC0415", # import-outside-top-level - "PLC2801", # unnecessary-dunder-call - "PLC0206", # dict-index-missing-items - "PLC1901", # compare-to-empty-string - "PLC2701", # import-private-name - "PLC0414", # useless-import-alias - - # Pylint refactor - "PLR0915", # too-many-statements - "PLR0914", # too-many-locals - "PLR0913", # too-many-arguments - "PLR0912", # too-many-branches - "PLR1702", # too-many-nested-blocks - "PLR0904", # too-many-public-methods - "PLR6301", # no-self-use - "PLR0917", # too-many-positional-arguments - "PLR6201", # literal-membership - "PLR0911", # too-many-return-statements - "PLR2004", # magic-value-comparison - "PLR1714", # repeated-equality-comparison - "PLR6104", # non-augmented-assignment - "PLR1704", # redefined-argument-from-local - "PLR0916", # too-many-boolean-expressions - "PLR5501", # collapsible-else-if - "PLR1711", # useless-return - "PLR1730", # if-stmt-min-max - "PLR1736", # unnecessary-list-index-lookup - "PLR1733", # unnecessary-dict-index-lookup - - # Pylint warning - "PLW2901", # redefined-loop-name - "PLW1641", # eq-without-hash - "PLW1514", # unspecified-encoding - "PLW0602", # global-variable-not-assigned - "PLW0603", # global-statement - "PLW0108", # unnecessary-lambda - "PLW1510", # subprocess-run-without-check - "PLW0120", # useless-else-on-loop - - # Flake8 core - # "F841", # unused-variable (540) -] - - -[tool.ruff.lint.isort] -required-imports = ["from __future__ import annotations"] - -[tool.ruff.lint.pylint] -max-args = 5 -max-locals = 15 -max-returns = 6 -max-branches = 12 -max-statements = 50 -max-nested-blocks = 5 -max-public-methods = 20 -max-bool-expr = 5 - -[tool.ruff.lint.pyupgrade] -keep-runtime-typing = true diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 000000000000..d44603e9b421 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,77 @@ +line-length = 120 + +[lint] +preview = true +select = [ + "PL", # Pylint + "I", # Isort + "FA", # Flake8: future-annotations + "UP", # Pyupgrade + # Flake8 core + "F", + "E", + "W", +] +explicit-preview-rules = false +ignore = [ + # Pylint convention + "PLC0105", # type-name-incorrect-variance + "PLC0415", # import-outside-top-level + "PLC2801", # unnecessary-dunder-call + "PLC0206", # dict-index-missing-items + "PLC1901", # compare-to-empty-string + "PLC2701", # import-private-name + "PLC0414", # useless-import-alias + + # Pylint refactor + "PLR0915", # too-many-statements + "PLR0914", # too-many-locals + "PLR0913", # too-many-arguments + "PLR0912", # too-many-branches + "PLR1702", # too-many-nested-blocks + "PLR0904", # too-many-public-methods + "PLR6301", # no-self-use + "PLR0917", # too-many-positional-arguments + "PLR6201", # literal-membership + "PLR0911", # too-many-return-statements + "PLR2004", # magic-value-comparison + "PLR1714", # repeated-equality-comparison + "PLR6104", # non-augmented-assignment + "PLR1704", # redefined-argument-from-local + "PLR0916", # too-many-boolean-expressions + "PLR5501", # collapsible-else-if + "PLR1711", # useless-return + "PLR1730", # if-stmt-min-max + "PLR1736", # unnecessary-list-index-lookup + "PLR1733", # unnecessary-dict-index-lookup + + # Pylint warning + "PLW2901", # redefined-loop-name + "PLW1641", # eq-without-hash + "PLW1514", # unspecified-encoding + "PLW0602", # global-variable-not-assigned + "PLW0603", # global-statement + "PLW0108", # unnecessary-lambda + "PLW1510", # subprocess-run-without-check + "PLW0120", # useless-else-on-loop + + # Flake8 core + # "F841", # unused-variable (540) +] + + +[lint.isort] +required-imports = ["from __future__ import annotations"] + +[lint.pylint] +max-args = 5 +max-locals = 15 +max-returns = 6 +max-branches = 12 +max-statements = 50 +max-nested-blocks = 5 +max-public-methods = 20 +max-bool-expr = 5 + +[lint.pyupgrade] +keep-runtime-typing = true