Skip to content

Commit

Permalink
Migrate pyproject.toml to ruff.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
Quexington committed Nov 4, 2024
1 parent 07443b7 commit fbd5e61
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 79 deletions.
79 changes: 0 additions & 79 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
77 changes: 77 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit fbd5e61

Please sign in to comment.