-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathruff.toml
More file actions
69 lines (57 loc) · 1.57 KB
/
Copy pathruff.toml
File metadata and controls
69 lines (57 loc) · 1.57 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
# Ruff configuration for Battery Energy Trading
# https://docs.astral.sh/ruff/
# Home Assistant standard line length
line-length = 100
# Target Python version
target-version = "py311"
[lint]
# Enable pycodestyle (E), Pyflakes (F), isort (I), pyupgrade (UP), and bugbear (B)
select = [
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
"RET", # flake8-return
"ARG", # flake8-unused-arguments
]
ignore = [
"E501", # line too long (handled by formatter)
"B008", # do not perform function calls in argument defaults
"RET504", # unnecessary variable assignment before return
"SIM108", # use ternary operator (sometimes less readable)
]
# Allow autofix for all enabled rules
fixable = ["ALL"]
unfixable = []
# Exclude specific files and directories
exclude = [
".git",
".ruff_cache",
".venv",
"__pycache__",
"build",
"dist",
"*.egg-info",
]
[lint.per-file-ignores]
"__init__.py" = ["F401"] # Allow unused imports in __init__.py
"tests/**/*.py" = [
"ARG001", # Unused function argument (fixtures)
"ARG002", # Unused method argument (fixtures)
]
[lint.isort]
known-first-party = ["custom_components"]
force-single-line = false
lines-after-imports = 2
[format]
# Use single quotes for strings
quote-style = "double"
# Use spaces for indentation
indent-style = "space"
# Line length (matches Home Assistant standards)
line-ending = "auto"
# Respect magic trailing comma
skip-magic-trailing-comma = false