added ruff config

This commit is contained in:
Johan Lundberg 2026-03-31 15:40:37 +02:00
parent 2745471412
commit 2b652ff603
No known key found for this signature in database
GPG key ID: A6C152738D03C7D1

61
ruff.toml Normal file
View file

@ -0,0 +1,61 @@
# Set the maximum line length to 120.
line-length = 120
target-version = "py313"
[lint]
select = [
"A",
"ANN",
"ASYNC",
"B",
"C4",
"DTZ",
"E",
"ERA",
"F",
"FAST",
"FLY",
"FURB",
"I",
"ISC",
"PERF",
"PGH",
"PIE",
"PL",
"PT",
"RUF",
"SIM",
"UP",
"W",
]
ignore = [
"SIM102", # collapsible-if
"SIM103", # return-bool-condition-directly (keeping explicit if/else for clarity)
"SIM108", # if-else-block-instead-of-if-exp
# Since we use ruff as a formatter, the following rules should be ignored
# See: https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191",
"E111",
"E114",
"E117",
"E501",
"D206",
"D300",
"Q000",
"Q001",
"Q002",
"Q003",
"COM812",
"COM819",
"ISC002",
]
allowed-confusables = ["", "х"]
[lint.flake8-annotations]
allow-star-arg-any = true
[lint.per-file-ignores]
"**/test_*.py" = ["PLR2004"] # magic-value-comparison - allow magic numbers in tests