-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathruff.toml
More file actions
30 lines (28 loc) · 1.69 KB
/
Copy pathruff.toml
File metadata and controls
30 lines (28 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# CI validates both the minimum and current Home Assistant runtimes. Keep the
# conservative Python 3.10 syntax target until modernization is handled as a
# separate change; the forward-compatibility lane must not silently raise it.
target-version = "py310"
line-length = 88
[lint]
# Mirror the previous flake8 + isort behaviour: pycodestyle (E/W), pyflakes (F)
# and import sorting (I, equivalent to isort profile=black). E203/E501 were
# ignored by flake8; E721 is stricter in ruff than pycodestyle, so keep it off
# to avoid new findings the old tool chain never reported.
# B (bugbear), C4 (comprehensions), PIE and RUF catch real bugs/dead code
# cheaply across the whole tree, including source/.
# UP (pyupgrade) replaces the standalone pyupgrade pre-commit hook - one tool,
# one target-version. ISC (implicit string concat) and RET (flake8-return)
# resolved fully clean across the whole tree with zero manual fixes needed.
# SIM/PERF/T20 were evaluated too, but almost every hit there has no automatic
# fix and would mean hand-rewriting hundreds of loops/prints across source/ -
# deferred to a separate, deliberate cleanup effort rather than bundled here.
select = ["E", "F", "W", "I", "B", "C4", "PIE", "RUF", "UP", "ISC", "RET"]
# E203/E501/E721: see above. RUF001-003 flag "ambiguous" unicode (en-dashes,
# curly quotes) that legitimately occurs in non-English provider names/titles.
# RET503/RET504 have no automatic fix and would require hand-rewriting return
# statements across dozens of source/ files for a purely stylistic gain -
# not worth the manual diff right now.
ignore = ["E203", "E501", "E721", "RUF001", "RUF002", "RUF003", "RET503", "RET504"]
[format]
quote-style = "double"
indent-style = "space"