Skip to content

fix(reporter): suppress --report-markdown hint when markdown report is already enabled#726

Merged
abhisek merged 2 commits into
safedep:mainfrom
taiman724:fix/markdown-report-hint-text
May 14, 2026
Merged

fix(reporter): suppress --report-markdown hint when markdown report is already enabled#726
abhisek merged 2 commits into
safedep:mainfrom
taiman724:fix/markdown-report-hint-text

Conversation

@taiman724

@taiman724 taiman724 commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary

The hint at pkg/reporter/summary.go:556 unconditionally prints Run vet with --report-markdown=... even when the user has already passed --report-markdown. This adds a MarkdownReportEnabled field to SummaryReporterConfig and gates the println on it so the hint is shown only when markdown output is not enabled. scan and query subcommands both pass the flag state through.

Fixes #725.

Change

  • pkg/reporter/summary.go: Add MarkdownReportEnabled bool field with a godoc comment, wrap the existing fmt.Println hint in an if !r.config.MarkdownReportEnabled guard.
  • scan.go: pass MarkdownReportEnabled: !utils.IsEmptyString(markdownReportPath) when constructing the SummaryReporterConfig.
  • query.go: same as above.

The new field is a bool whose zero value is false, preserving backward-compatible behavior for any existing SummaryReporterConfig{} literal (only pkg/reporter/markdown.go:66 has another instantiation, and its nested summary never calls Finish() — confirmed by tracing).

The mirror predicate !utils.IsEmptyString(markdownReportPath) is the same one used at scan.go:644 and query.go:256 to decide whether to instantiate the markdown reporter at all.


Prepared with AI assistance (Claude Sonnet 4.6 via Claude Code).

…s already enabled

The hint at pkg/reporter/summary.go:556 unconditionally prints
"Run vet with --report-markdown=..." even when the user has already
passed --report-markdown. This adds a MarkdownReportEnabled field to
SummaryReporterConfig and gates the println on it so the hint is
shown only when markdown output is NOT enabled. scan and query
subcommands both pass the flag state through.

Fixes #725

Signed-off-by: Shunta Hayashi <201278530+taiman724@users.noreply.github.com>
@safedep

safedep Bot commented May 13, 2026

Copy link
Copy Markdown

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

No dependency changes detected. Nothing to scan.

View complete scan results →

This report is generated by SafeDep Github App

@abhisek abhisek enabled auto-merge (squash) May 14, 2026 09:59
@abhisek abhisek merged commit e8e0162 into safedep:main May 14, 2026
13 checks passed
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.

vet CLI recommends using --report-markdown for markdown reports, but its still shown when markdown-report is used.

2 participants