@@ -54,30 +54,6 @@ packages = { find = { where = ["src", "."], include = ["ha_mcp*", "tests"] } }
5454[tool .setuptools .package-data ]
5555ha_mcp = [" py.typed" , " _pypi_marker" , " resources/*.md" , " resources/*.json" ]
5656
57- [tool .black ]
58- line-length = 88
59- target-version = [' py313' ]
60- include = ' \.pyi?$'
61- extend-exclude = '''
62- /(
63- # directories
64- \.eggs
65- | \.git
66- | \.hg
67- | \.mypy_cache
68- | \.tox
69- | \.venv
70- | build
71- | dist
72- )/
73- '''
74-
75- [tool .isort ]
76- profile = " black"
77- multi_line_output = 3
78- line_length = 88
79- known_first_party = [" ha_mcp" ]
80-
8157[tool .mypy ]
8258python_version = " 3.11"
8359warn_return_any = true
@@ -102,30 +78,43 @@ ignore_missing_imports = true
10278[tool .ruff ]
10379target-version = " py313"
10480line-length = 88
81+ extend-exclude = [" tests/initial_test_state" ]
10582
10683[tool .ruff .lint ]
10784select = [
108- " E" , # pycodestyle errors
109- " W" , # pycodestyle warnings
110- " F" , # pyflakes
111- " I" , # isort
112- " B" , # flake8-bugbear
113- " C4" , # flake8-comprehensions
114- " UP" , # pyupgrade
115- " RUF100" , # unused noqa
85+ " E" , # pycodestyle errors
86+ " W" , # pycodestyle warnings
87+ " F" , # pyflakes
88+ " I" , # isort
89+ " B" , # flake8-bugbear
90+ " C4" , # flake8-comprehensions
91+ " UP" , # pyupgrade
92+ " RUF" , # ruff-specific rules
93+ " PIE" , # misc lints
94+ " PERF" , # performance anti-patterns
95+ " ASYNC" , # async best practices
96+ " A" , # builtin shadowing
97+ " LOG" , # logging best practices
98+ " SIM" , # simplify
11699]
117100ignore = [
118- " E501" , # line too long, handled by black
119- " B008" , # do not perform function calls in argument defaults
120- " C901" , # too complex
121- " B904" , # raise exceptions with from None/err - non-critical
122- " F841" , # local variable assigned but never used
123- " B007" , # loop control variable not used within loop body
124- " W293" , # blank line contains whitespace
125- " W291" , # trailing whitespace
126- " F821" , # undefined name (often false positives in complex imports)
127- " E722" , # bare except (temporary for cleanup)
128- " I001" , # import sorting handled by isort
101+ " E501" , # line too long — formatter handles this
102+ " B008" , # function calls in defaults — FastMCP pattern
103+ " C901" , # complexity — too many to fix now
104+ " SIM102" , # collapsible-if — sometimes less readable
105+ " SIM108" , # ternary — sometimes less readable
106+ " SIM105" , # contextlib.suppress — style preference
107+ " ASYNC109" ,# timeout params are standard in HA API patterns
108+ " RUF001" , # ambiguous unicode — HA entity names use degree symbols etc
109+ " RUF003" , # ambiguous unicode in comments
110+ " RUF010" , # explicit f-string type conversion — str(x) is clearer than !s
111+ " F841" , # unused variable — too many to fix now
112+ " RUF059" , # unused unpacked variable
113+ " SIM118" , # in-dict-keys — style preference
114+ " PIE810" , # multiple-starts-ends-with — style preference
115+ " RUF005" , # collection-literal-concatenation
116+ " RUF022" , # unsorted-dunder-all
117+ " RUF013" , # implicit-optional
129118]
130119
131120[tool .ruff .lint .per-file-ignores ]
@@ -161,10 +150,8 @@ asyncio_mode = "auto"
161150
162151[dependency-groups ]
163152dev = [
164- " black>=23.0.0" ,
165153 " build>=1.2.2" ,
166154 " docker>=7.1.0" ,
167- " isort>=5.12.0" ,
168155 " mypy>=1.17.0" ,
169156 " psutil>=7.0.0" ,
170157 " pytest>=8.4.2" ,
0 commit comments