-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.ruff.toml
More file actions
79 lines (72 loc) · 3.45 KB
/
Copy path.ruff.toml
File metadata and controls
79 lines (72 loc) · 3.45 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# The contents of this file is based on https://github.com/home-assistant/core/blob/dev/pyproject.toml
target-version = "py314"
[lint]
select = [
"ALL",
]
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"ANN001", # Allow missing type annotations where practical
"D203", # no-blank-line-before-class (incompatible with formatter)
"D212", # multi-line-summary-first-line (incompatible with formatter)
"COM812", # incompatible with formatter
"ISC001", # incompatible with formatter
"TC001", # type-checking import suggestions not enforced
"TC002", # type-checking import suggestions not enforced
"TC003", # type-checking import suggestions not enforced
"PLR0911", # allow multiple returns in complex functions
"PLR0912", # allow branching in complex functions
"PLR0915", # allow statement count in complex functions
"PLR2004", # allow magic numbers where clear
"E501", # allow longer lines where clearer
"DTZ005", # allow naive datetime where acceptable
"PERF401", # allow explicit loops for clarity
"TRY003", # allow formatted exception messages
"TRY400", # allow logging.error in exceptions
"BLE001", # allow broad exceptions in controlled areas
"ARG001", # allow unused args in test fixtures/hooks
"ARG002", # allow unused kwargs in entity methods
"PLC0415", # allow imports inside functions where needed
"C901", # allow higher complexity in select functions
"EM102", # allow direct f-strings in exceptions
"FBT001", # allow bool positional args where clear
"TRY300", # allow return before except blocks
"SIM110", # allow explicit loops over any()
"TRY301", # allow raises in place
"ASYNC109", # allow timeout parameters in async defs
"SIM117", # allow nested async context managers
"TRY401", # allow logger.exception with err param
"TRY002", # allow generic exceptions for flow
"F841", # allow intentionally unused locals
"ANN201", # allow missing return type for tests/fixtures
"PT011", # allow broad pytest.raises where sufficient
"SIM105", # allow try/except pass patterns
]
[lint.flake8-pytest-style]
fixture-parentheses = false
[lint.pyupgrade]
keep-runtime-typing = true
[lint.mccabe]
max-complexity = 25
[lint.per-file-ignores]
"custom_components/unraid_management_agent/api/__init__.py" = [
"RUF022", # Vendored API export surface stays grouped for readability
]
"custom_components/unraid_management_agent/api/*.py" = [
"ANN204", # Vendored API special methods are kept close to upstream style
"D107", # Vendored API __init__ docstrings are not normalized to repo style
"FBT002", # Vendored API preserves bool positional defaults from upstream client surface
"FBT003", # Vendored API Pydantic Field defaults preserve upstream call style
"PLR0913", # Vendored API constructors and client methods keep upstream signatures
"PLR1714", # Vendored API coercion helpers keep explicit comparisons from upstream
"PYI034", # Vendored API async context managers return concrete self types
"PYI036", # Vendored API __aexit__ annotations are preserved from upstream
"RUF046", # Vendored formatting helpers preserve upstream integer formatting
]
"tests/**/*.py" = [
"ANN001", # allow untyped test arguments
"PLR2004", # allow magic values in tests
"S101", # allow asserts in tests
"TC002", # allow test imports outside type-checking blocks
"SLF001", # allow private member access in tests
]