Files
chia-blockchain/ruff.toml
T
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Kyle Altendorf
f12c3b886d build(deps): bump ruff from 0.8.1 to 0.8.5 (#19102)
* build(deps): bump ruff from 0.8.1 to 0.8.5

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.8.1 to 0.8.5.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.8.1...0.8.5)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* update ignore list

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
2025-01-08 09:27:26 -07:00

103 lines
2.9 KiB
TOML

line-length = 120
[lint]
preview = true
select = [
"PL", # Pylint
"I", # Isort
"FA", # Flake8: future-annotations
"UP", # Pyupgrade
"RUF", # Ruff specific
"F", # Flake8 core
"ASYNC", # Flake8 async
"ISC", # flake8-implicit-str-concat
"TID", # flake8-tidy-imports
"E",
"W",
]
explicit-preview-rules = false
ignore = [
# Pylint convention
"PLC0415", # import-outside-top-level
"PLC1901", # compare-to-empty-string
# Should probably fix these
"PLC2801", # unnecessary-dunder-call
"PLC2701", # import-private-name
# 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
"PLR0917", # too-many-positional-arguments
"PLR0916", # too-many-boolean-expressions
"PLR0911", # too-many-return-statements
# Should probably fix these
"PLR6301", # no-self-use
"PLR2004", # magic-value-comparison
"PLR1704", # redefined-argument-from-local
"PLR5501", # collapsible-else-if
# Pylint warning
"PLW1641", # eq-without-hash
# Should probably fix these
"PLW2901", # redefined-loop-name
"PLW1514", # unspecified-encoding
"PLW0603", # global-statement
# Flake8 async
# Should probably fix these
"ASYNC230", # blocking-open-call-in-async-function
# Should probably fix these after dealing with shielding for anyio
"ASYNC109", # async-function-with-timeout
# flake8-implicit-str-concat
"ISC003", # explicit-string-concatenation
# pyupgrade
# Should probably fix these
"UP006", # non-pep585-annotation
# Ruff Specific
# This code is problematic because using instantiated types as defaults is so common across the codebase.
# Its purpose is to prevent accidenatally assigning mutable defaults. However, this is a bit overkill for that.
# That being said, it would be nice to add some way to actually guard against that specific mutable default behavior.
"RUF009", # function-call-in-dataclass-default-argument
"RUF056", # falsy-dict-get-fallback
# Should probably fix this
"RUF029", # unused-async
"RUF043", # pytest-raises-ambiguous-pattern
"RUF046", # unnecessary-cast-to-int
"RUF052", # used-dummy-variable
]
[lint.flake8-implicit-str-concat]
# Found 3279 errors.
# allow-multiline = false
[lint.flake8-tidy-imports]
ban-relative-imports = "all"
[lint.flake8-tidy-imports.banned-api]
"asyncio.create_task".msg = "Use `from chia.util.task_referencer import create_referenced_task` and `create_referenced_task()`"
[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