Skip to content

Add Markdown report output #1

Description

@gokul-debugger

Problem

ContribCheck currently renders inspection reports as a Rich terminal table or JSON. Contributors often need a portable report they can paste into an issue, pull request, or review note without manually reformatting the terminal output.

Proposed change

Add a --markdown option to contribcheck inspect that renders the existing InspectionReport as plain GitHub-flavored Markdown.

contribcheck inspect owner/repository#123 --markdown
contribcheck inspect owner/repository#123 --markdown --output report.md

Acceptance criteria

  • contribcheck inspect <ref> --markdown prints Markdown without ANSI escape sequences.
  • The report includes the issue title and URL, overall verdict, check statuses and summaries, linked evidence, and next actions.
  • Evidence entries render as links when a URL is present, and as plain text otherwise.
  • --markdown and --json are mutually exclusive and produce a clear CLI error when combined.
  • Optional --output <path> writes the Markdown to a file instead of stdout.
  • Existing terminal and JSON output remain unchanged.
  • Focused CLI tests cover successful rendering, linked evidence, the conflicting-option error, and (if implemented) file output.
  • The README documents the new option with a short example.

Implementation guidance

Rendering already lives in one place: _render_report in src/contribcheck/cli.py, and the --json branch that skips it is in the inspect command (around cli.py:68). Add a Markdown renderer next to _render_report and route --markdown through the same branch, so the analyzer keeps returning the same typed InspectionReport model.

Example shape for one check:

## Verdict: READY

| Status | Check | Finding |
| --- | --- | --- |
| PASS | Issue state | The issue is open. |
| PASS | Dependencies | No open blockers reported. |

## Next actions

- Read the repository contribution guide before creating a branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions