Skip to content

Commit 53f7c05

Browse files
authored
refactor(complexity): migrate tools_utility.py to class-based pattern (#1423)
* refactor(complexity): migrate tools_utility.py to class-based pattern Extracts UtilityTools class from register_utility_tools closure, removing the C901 suppression for this file from pyproject.toml. - register_utility_tools (92) reduced to thin wrappers (~2) - get_logs (20) reduced via _validate_log_level, _collect_log_warnings, _validate_log_slug, _fetch_log_source helpers - _get_logbook (16) reduced via _coerce_logbook_params, _build_pagination_hint - _get_logger_info (11) reduced via _parse_logger_entry static method - _get_system_service_log (11) reduced via _addon_auth_error_suggestions static method - slug type narrowed with assert in _fetch_log_source instead of type: ignore * fix: resolve implicit string concatenation in _addon_auth_error_suggestions
1 parent 1631ad1 commit 53f7c05

2 files changed

Lines changed: 393 additions & 350 deletions

File tree

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ ignore = [
145145
"src/ha_mcp/tools/tools_entities.py" = ["C901"]
146146
"src/ha_mcp/tools/tools_registry.py" = ["C901"]
147147
"src/ha_mcp/tools/tools_search.py" = ["C901"]
148-
"src/ha_mcp/tools/tools_utility.py" = ["C901"]
149148
"src/ha_mcp/tools/smart_search.py" = ["C901"]
150149

151150
[tool.pytest.ini_options]

0 commit comments

Comments
 (0)