fix(reporter): suppress --report-markdown hint when markdown report is already enabled#726
Merged
Merged
Conversation
…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 Report SummaryNo dependency changes detected. Nothing to scan. This report is generated by SafeDep Github App |
abhisek
approved these changes
May 14, 2026
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.



Summary
The hint at
pkg/reporter/summary.go:556unconditionally printsRun vet with --report-markdown=...even when the user has already passed--report-markdown. This adds aMarkdownReportEnabledfield toSummaryReporterConfigand gates the println on it so the hint is shown only when markdown output is not enabled.scanandquerysubcommands both pass the flag state through.Fixes #725.
Change
pkg/reporter/summary.go: AddMarkdownReportEnabled boolfield with a godoc comment, wrap the existingfmt.Printlnhint in anif !r.config.MarkdownReportEnabledguard.scan.go: passMarkdownReportEnabled: !utils.IsEmptyString(markdownReportPath)when constructing theSummaryReporterConfig.query.go: same as above.The new field is a
boolwhose zero value isfalse, preserving backward-compatible behavior for any existingSummaryReporterConfig{}literal (onlypkg/reporter/markdown.go:66has another instantiation, and its nested summary never callsFinish()— confirmed by tracing).The mirror predicate
!utils.IsEmptyString(markdownReportPath)is the same one used atscan.go:644andquery.go:256to decide whether to instantiate the markdown reporter at all.Prepared with AI assistance (Claude Sonnet 4.6 via Claude Code).