Zero out remaining basedpyright targeted diagnostics - #33
Merged
Conversation
… ignores + test type-narrowing) Drives all targeted basedpyright classes to zero across src/claude_comms and tests (274 -> 0): reportUnusedFunction/Parameter/Variable/Import, reportUnreachable, reportArgumentType, reportAttributeAccessIssue, reportOptionalMemberAccess, reportReturnType, reportUnnecessary*. Behavior-preserving only: type-narrowing asserts, isinstance guards, accurate return/param annotations, ParticipantType narrowing on test helpers, an added unused defaulted retain param on mock publish callbacks to satisfy the PublishFn protocol, and per-line pyright ignores on defensive runtime guards, autouse fixtures, and intentional negative-test bad-value calls. No logic changes. Baseline type-inference noise (reportAny/reportUnknown*/reportMissingTypeArgument etc.) is intentionally out of scope and left unchanged.
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.
Summary
Final basedpyright cleanup: drives all targeted diagnostic classes to ZERO across
src/claude_commsandtests(274 → 0), with behavior-preserving changes only.Targeted classes zeroed (before → after)
What changed (behavior-preserving only)
assert x is not Nonebefore optional member access (reg.get(key).connections,.profile_status_*,.recipients, etc.);assert isinstance(block, TextContent)before.texton MCP content-block unions;assert isinstance(result, Panel)in the TUI bubble test helper.-> Iterator[RegistryStore]; test helpers narrowedstr→ParticipantType(all callers pass valid literals);_bubble_panel -> Panel; an ASGI test wrapper widened toMutableMapping[str, Any].retain: bool = Falseto mock publish callbacks so they match thePublishFnprotocol (the protocol matches by parameter name, so callback param names were preserved).pilot.app→ typed localappacross the TUI tests (same object, already typedClaudeCommsApp) to resolve private-attribute access.# pyright: ignore[...]only where a fix would otherwise change behavior: defensive runtime guards in source (isinstance/raiseon already-typed params),@pytest.fixture(autouse=True)helpers reported unused, and intentional negative-test bad-value calls (type="robot",op="wat",Noneargs)._-prefixed; pytest fixture params kept their names with a def-line ignore (renaming would break injection).No logic changes, no deleted live code. The MCP tools and all tests behave identically.
Out of scope (intentionally untouched)
Pre-existing project-wide type-inference noise —
reportAny,reportUnknown*,reportExplicitAny,reportMissingParameterType,reportMissingTypeArgument,reportConstantRedefinition,reportDeprecated,reportImplicitStringConcatenation, and the other non-targeted error classes (reportImplicitRelativeImport,reportOptionalSubscript, etc.) — is unchanged (verified identical before/after).Verification
.venv/bin/basedpyright src/claude_comms tests: targeted classes = 0 (baseline noise unchanged)..venv/bin/ruff checkclean;.venv/bin/ruff format --checkclean..venv/bin/python -m pytest -q: 1467 passed.🤖 Generated with Claude Code