Skip to content

[FEAT] --summary-markdown flag: Export compliance report as Markdown #55

@Joseph94m

Description

@Joseph94m

Feel free to propose other implementation details / output structure.

Is your feature request related to a problem? Please describe.

Users who want to attach Plumber results to GitLab MR descriptions, wikis, or external documentation have no way to get a portable, readable text output. The current --output flag produces JSON only, and the terminal output uses ANSI escape codes that don't copy-paste well.

Describe the solution you'd like

Add a --summary-markdown flag to the analyze command that writes a clean Markdown-formatted compliance report to a file path.

The Markdown should include:

  • Project name and analysis timestamp
  • A table of all controls with compliance % and issue count (mirrors the existing printComplianceTable logic)
  • A collapsible details block per control listing specific issues

Implementation Hints

This is just a proposition. Feel free to change.

  1. Add the flag in cmd/analyze.go next to outputFile
  2. Reuse the existing result *control.AnalysisResult: all data is already available
  3. Create a new function writeMarkdownToFile(result, threshold, compliance, filePath) following the same pattern as writeJSONToFile
  4. No new dependencies needed: just fmt.Sprintf and os.WriteFile

Files Touched

cmd/analyze.go (add flag + write function)

Why It's Valuable

Enables integration with GitLab MR descriptions, wikis, Confluence pages, and CI/CD artifact previews. This is a natural complement to the existing JSON output.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions