feat(cli): add --quiet flag to suppress info-level stderr diagnostics#62
Open
not-knope wants to merge 1 commit into
Open
feat(cli): add --quiet flag to suppress info-level stderr diagnostics#62not-knope wants to merge 1 commit into
not-knope wants to merge 1 commit into
Conversation
When running scheduled scans, info diagnostics (resolved roots and the final scan-complete line) clutter stderr even on success. Operators piping NDJSON to a sink only want stderr when something is wrong; warn and error diagnostics still emit with --quiet. Co-authored-by: Cursor <cursoragent@cursor.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.
Closes #48
What changed
--quiettobumblebee scanto suppress info-level diagnostics on stderr.output.Emitterwith aquietmode (SetQuiet) soDiag("info", ...)is counted but not written when quiet is enabled.--quiet.scan_summary, exit codes, and default (non-quiet) behavior are unchanged.internal/output/output_test.goand documented the flag inREADME.md.Why
Scheduled CI/cron scans that pipe NDJSON to a downstream sink currently emit noisy info diagnostics on every successful run (resolved-root notes and the final
scan complete:line). Operators want stderr only when something is actually wrong. See #48.How I tested it
go build ./... go vet ./... go test ./internal/output/... -run TestDiag -v go run ./cmd/bumblebee selftestAll of the above passed on Windows (Go 1.25).
Note:
go test ./... -racerequires CGO on this host and was not run here. Fullgo test ./...on Windows hits pre-existing platform-specific failures in root-resolution tests (Unix path assumptions); unrelated to this change.Out of scope / limitations
-qshort alias: the stdlibflagpackage registers--quietonly (same as the reference PR feat(cli): add --quiet flag to suppress info-level stderr diagnostics #53).selftest --quiet(already exists separately).Note
This PR was developed with AI assistance (Cursor), as reflected in the
commit's Co-authored-by trailer. All code was reviewed, tested, and
verified locally before submission — the design decision to centralize
the quiet logic in Emitter.Diag() and the final verification steps
(build, vet, tests, selftest) were done manually.