forked from wills106/homeassistant-solax-modbus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
111 lines (95 loc) · 2.49 KB
/
Copy pathpyproject.toml
File metadata and controls
111 lines (95 loc) · 2.49 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
[project]
name = "homeassistant-solax-modbus"
version = "0.0.0"
description = "SolaX Modbus integration for Home Assistant"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"pymodbus>=3.8.3",
"tmodbus[async-serial,smart]==0.4.1",
]
[dependency-groups]
dev = [
"pre-commit>=4.0.0",
"codespell>=2.2.6",
"ruff>=0.14.14",
"mypy>=1.8.0",
]
test = [
"pytest>=8.0.0",
"pytest-homeassistant-custom-component>=0.13.0",
"pytest-asyncio>=0.24.0,<1.0.0",
"pytest-cov>=4.1.0",
]
[tool.ruff]
line-length = 150
target-version = "py312"
[tool.ruff.lint]
# Phase C: Default linting rules (E, F, W) + import sorting (I)
# Phase D: OSS best practices (B, UP) to match FastAPI, Pydantic, HA Core
select = ["E", "F", "W", "I", "B", "UP"]
ignore = [
"E501", # Line too long - handled by formatter at 150 chars
]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "lf"
[tool.codespell]
ignore-words-list = "hass,alot,datas,dof,fom,inout,ist,nam,nd,od,portugues,pullrequests,resset,rime,ser,te,ue,ue,uint,visability,wan,wanna,withing,wit,ocurr"
skip = "*.csv,*.json"
[tool.pytest.ini_options]
testpaths = ["tests"]
norecursedirs = [".git", "testing_config"]
asyncio_mode = "strict"
asyncio_default_fixture_loop_scope = "function"
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
]
[tool.mypy]
# Python version targeting HA 2024.9.0+ (Python 3.12)
python_version = "3.12"
# Package resolution
explicit_package_bases = true
# Phase 4: Full strict mode
strict = true
warn_return_any = true
warn_unused_configs = true
# Only ignore truly missing stubs (use per-import overrides instead)
ignore_missing_imports = false
# Strictest settings
disallow_untyped_defs = true
disallow_untyped_calls = true
disallow_incomplete_defs = true
disallow_any_generics = true
check_untyped_defs = true
# Additional strict checks
warn_redundant_casts = true
warn_unused_ignores = true
warn_unreachable = true
no_implicit_reexport = true
no_implicit_optional = true
# Output configuration
show_error_codes = true
show_column_numbers = true
pretty = true
# Files to check
files = [
"custom_components/solax_modbus",
"tests",
]
# Exclude patterns
exclude = [
"^scripts/",
"^\\.venv/",
]
# Per-import overrides for dependencies without type stubs
[[tool.mypy.overrides]]
module = [
"pymodbus.*",
"homeassistant.*",
"pytest_homeassistant_custom_component.*",
"pytest.*",
]
ignore_missing_imports = true