Add a Markdown reporter for PR comments and CI summaries#91
Open
AnshBajpai05 wants to merge 1 commit into
Open
Add a Markdown reporter for PR comments and CI summaries#91AnshBajpai05 wants to merge 1 commit into
AnshBajpai05 wants to merge 1 commit into
Conversation
--markdown report.md writes a GitHub-flavored report: summary, top-functions table, and — when --compare is given — a comparison table with regression/improvement icons, new/removed lists and a regression banner. Drops straight into a PR comment or $GITHUB_STEP_SUMMARY. The reporter is a pure consumer of the ComparisonData from KaykCaputo#90; it reimplements no comparison logic. To make the comparison available at export time, the compare step is split into _load_comparison / _export_results / _report_comparison, with no change to existing flags, output or exit codes. Co-Authored-By: Claude Fable 5 <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.
Third slice from #80, built on the comparison/reporter split (#90).
What it adds
--markdown report.md— a GitHub-flavored report you can drop straight into a PR comment or$GITHUB_STEP_SUMMARY:Contents:
--compareis given: a comparison table with 🔴/🟢 per changed function, new/removed function lists, and a regression banner (🚨 count / ✅ none)Example (a real run against a shrunk baseline):
How it stays clean
The reporter is a pure consumer of
ComparisonDatafrom #90 — it re-implements none of the comparison logic. That's exactly what the split was for:render_markdown(data, comparison, top)reads statuses and renders; a future JUnit or other reporter is the same shape.Function names are escaped (
|and backtick) so a name can't break out of a table cell or inline code.Wiring
--markdownis added to the base parser and tobaseline save, mirroring--html. To let the Markdown report include the comparison, the compare step was split so the result is available at export time:_load_comparison()(load baseline + compare) →_export_results(data, args, comparison)→_report_comparison()(print + regression gate). No behavior change for existing flags — the terminal comparison, exit-2 gate, and every other export are unchanged; comparison errors still return exit 1 with the same messages.Tests
test_markdown_reporter.py— header/summary, top table sorting +--toplimit, pipe-escaping, comparison table with icons, regression/no-regression banners, new/removed lists, file writing, self-contained (only the footer link).test_cli.py—--markdownwrites a file end-to-end, and--compare --markdownincludes the comparison section.Full suite green locally (the one failure on my machine is the pre-existing
test_symlinked_user_code, which needs Windows symlink privileges and passes on CI).🤖 Generated with Claude Code