Clear basedpyright unused/unreachable/type diagnostics in core server files - #30
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Drives the authoritative basedpyright checker's targeted diagnostic classes to ZERO across the three core server files (
cli.py,mcp_server.py,mcp_tools.py) with no runtime behavior change.Diagnostic classes fixed (91 -> 0)
mcp_server.get_all_conversationsannotatedentry: dict[str, Any](3);mcp_tools.auto_expire_profile_statuses_loopnowcasts the provider result toPublishFn | None(1)._(e.g._ = await client.subscribe(...),_ = registry.join(...))._expand_loopback_aliases(cli) and dead_get_presence(mcp_server) removed; the 30@mcp.tool()-decoratedcomms_*registrations get a per-def# pyright: ignore[reportUnusedFunction](the decorator use is not counted by basedpyright; the functions are live MCP tools and must NOT be deleted).del <param>as the first body statement (_noop_publishtopic/payload/retain;tool_comms_kickconv_data_dir;tool_comms_dm_open/tool_comms_conversation_archive/tool_comms_conversation_unarchivepublish_fn). Underscore-prefixing is insufficient.isinstance(..., str/bytes)guards on already-typed inputs kept intact (behavior-preserving) and silenced with targeted inline ignores.and _publish_fn is not Nonechecks dropped in twocomms_conversation_*handlers where a precedingassert _publish_fn is not Nonealready narrows the type.Out of scope (intentionally left)
The broad codebase-wide type-inference baseline noise is NOT touched:
reportUnknown*,reportAny,reportExplicitAny,reportMissingParameterType,reportMissingTypeArgument,reportConstantRedefinition, etc. These are pre-existing baseline diagnostics unrelated to this cleanup.Verification
basedpyrighton the 3 files: targeted classes 91 -> 0; remaining 33 errors / 939 warnings are all the out-of-scope baseline.ruff format+ruff check: clean.pytest: 1456 passed.🤖 Generated with Claude Code