added ruff config
This commit is contained in:
parent
2745471412
commit
2b652ff603
1 changed files with 61 additions and 0 deletions
61
ruff.toml
Normal file
61
ruff.toml
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue