Skip to content

[deep-report] Add console.Print* wrappers to eliminate 1,640 two-step stderr calls #47097

Description

@github-actions

Description

The pkg/console package exposes Format* styled-output functions but no Print* wrappers, so every caller re-implements fmt.Fprintln(os.Stderr, console.Format*(...)) by hand. The Repository Quality report (discussion #47087) profiled 1,640 two-step calls, 94 Fprintf variants, and 239 raw fmt.Fprintf(os.Stderr, ...) calls that bypass styling entirely. Add thin Print* helpers (mirroring each Format*) that write to os.Stderr internally, then migrate the two worst files: pkg/cli/mcp_inspect_mcp.go (70 raw calls) and pkg/cli/engine_secrets.go (63 raw calls).

Expected Impact

Removes the stdout/stderr mis-routing footgun, centralizes newline handling, and creates a single interception point for testing/WASM/observability. A follow-up linter can lock it in permanently.

Suggested Agent

Code Simplifier / File Diet agent (Copilot).

Estimated Effort

Medium (1-4 hours) — wrappers are trivial; scope migration to the 2 worst files.

Data Source

DeepReport analysis 2026-07-21; discussion #47087.

Generated by 🔬 Deep Report · age00 200.9 AIC · ⌖ 17.2 AIC · ⊞ 9.9K ·

  • expires on Jul 23, 2026, 7:27 AM UTC-08:00

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions