Skip to content

fix(reporter): correct build_pipeline_output return annotation + docstring to tuple[str, int]#106

Open
gadievron wants to merge 1 commit into
masterfrom
fix/reporter-correct-build-pipeline-output-return-annotation-docstring
Open

fix(reporter): correct build_pipeline_output return annotation + docstring to tuple[str, int]#106
gadievron wants to merge 1 commit into
masterfrom
fix/reporter-correct-build-pipeline-output-return-annotation-docstring

Conversation

@gadievron

Copy link
Copy Markdown
Collaborator

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

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant