fix(reporter): correct build_pipeline_output return annotation + docstring to tuple[str, int]#106
Open
gadievron wants to merge 1 commit into
Conversation
…tring to tuple[str, int] build_pipeline_output(...) was declared ``-> str`` with a docstring claiming it returns the single output_path, but its sole return is ``return output_path, len(findings_data)`` — a tuple[str, int]. The annotation and docstring went stale when the function gained a second return value; the binding caller (cli.py cmd_report) was migrated to unpack the tuple but the signature + docstring were not. Fix is annotation/docstring-only (runtime return unchanged, since the caller depends on the tuple): - ``-> str`` -> ``-> tuple[str, int]`` - Returns: docstring now describes the (output_path, findings_count) tuple. No cli.py edit: the sole binding caller already unpacks the tuple correctly and now type-aligns with the corrected annotation. New regression test pins the real contract (return is a 2-tuple) and asserts the annotation + docstring agree with it. RED -> GREEN: 2 failed -> 3 passed. ruff + ast clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
build_pipeline_output(...) was declared
-> strwith a docstring claiming itreturns the single output_path, but its sole return is
return output_path, len(findings_data)— a tuple[str, int]. The annotationand docstring went stale when the function gained a second return value; the
binding caller (cli.py cmd_report) was migrated to unpack the tuple but the
signature + docstring were not.
Fix is annotation/docstring-only (runtime return unchanged, since the caller
depends on the tuple):
-> str->-> tuple[str, int]No cli.py edit: the sole binding caller already unpacks the tuple correctly and
now type-aligns with the corrected annotation.
New regression test pins the real contract (return is a 2-tuple) and asserts
the annotation + docstring agree with it. RED -> GREEN: 2 failed -> 3 passed.
ruff + ast clean.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com