feat: adhere to ruff's B rules (#2423)

* feat: adhere to ruff's `B` rules
last of the ruff checks.
closes #2308
* B904
* B008
* B005
* B025
* cleanup on fake
This commit is contained in:
dni ⚡ 2024-04-17 13:11:51 +02:00 committed by GitHub
parent e13a37c193
commit 98ec59df96
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 226 additions and 169 deletions

View file

@ -181,7 +181,8 @@ extend-exclude = [
# N - naming
# UP - pyupgrade
# RUF - ruff specific rules
select = ["F", "E", "W", "I", "A", "C", "N", "UP", "RUF"]
# B - bugbear
select = ["F", "E", "W", "I", "A", "C", "N", "UP", "RUF", "B"]
# UP007: pyupgrade: use X | Y instead of Optional. (python3.10)
# RUF012: mutable-class-default
ignore = ["UP007", "RUF012"]
@ -206,3 +207,12 @@ classmethod-decorators = [
[tool.ruff.lint.mccabe]
# TODO: Decrease this to 10.
max-complexity = 16
[tool.ruff.lint.flake8-bugbear]
# Allow default arguments like, e.g., `data: List[str] = fastapi.Query(None)`.
extend-immutable-calls = [
"fastapi.Depends",
"fastapi.Query",
"fastapi.Body",
"lnbits.decorators.parse_filters"
]