Description
pkg/console/console.go already provides dedicated stderr-safe formatter variants (FormatInfoMessageStderr, FormatSuccessMessageStderr, FormatErrorStderr, FormatTableHeaderStderr), but a live grep today found roughly 1,662 call sites across ~192 files in pkg/cli that still pipe the plain (stdout-TTY-aware) Format*Message helpers into fmt.Fprintln(os.Stderr, ...) / fmt.Fprintf(os.Stderr, ...) instead of the *Stderr variant. Because the plain formatters make color/TTY decisions based on os.Stdout, output written to stderr this way can render inconsistently depending on which stream is actually a terminal (e.g., piped stdout with a terminal stderr, or vice versa).
Expected Impact
Prevents new stdout/stderr formatter mismatches from being introduced going forward, without requiring a disruptive, repo-wide mass edit of ~192 files right now.
Suggested Fix
Given the scale (1,662 occurrences), do not hand-fix all existing call sites as part of this task. Instead, add a custom golangci-lint rule under pkg/linters (following the existing custom-linter pattern in this repo) that flags fmt.Fprint(ln|f)(os.Stderr, ...) wrapping a non-Stderr-suffixed Format* call, so new call sites are caught in CI going forward. A separate, larger follow-up issue can track the bulk cleanup if the team decides it's worth doing.
Code Region: pkg/console/console.go (existing *Stderr helpers), pkg/linters/ (new rule)
Suggested Agent
Developer (Go linters)
Estimated Effort
Medium (2-4 hours)
Data Source
DeepReport Intelligence Briefing, 2026-10-08 (cycle 3). Source discussion #66843. Live-verified today: the *Stderr helpers exist in pkg/console/console.go; mismatch call-site count re-confirmed at ~1,662 via grep (higher than the source report's original count — the gap is still growing).
Generated by 🔬 Deep Report · claude · agent · 343.4 AIC · ⌖ 9.25 AIC · ⊞ 7.1K · ◷
Description
pkg/console/console.goalready provides dedicated stderr-safe formatter variants (FormatInfoMessageStderr,FormatSuccessMessageStderr,FormatErrorStderr,FormatTableHeaderStderr), but a live grep today found roughly 1,662 call sites across ~192 files inpkg/clithat still pipe the plain (stdout-TTY-aware)Format*Messagehelpers intofmt.Fprintln(os.Stderr, ...)/fmt.Fprintf(os.Stderr, ...)instead of the*Stderrvariant. Because the plain formatters make color/TTY decisions based onos.Stdout, output written to stderr this way can render inconsistently depending on which stream is actually a terminal (e.g., piped stdout with a terminal stderr, or vice versa).Expected Impact
Prevents new stdout/stderr formatter mismatches from being introduced going forward, without requiring a disruptive, repo-wide mass edit of ~192 files right now.
Suggested Fix
Given the scale (1,662 occurrences), do not hand-fix all existing call sites as part of this task. Instead, add a custom golangci-lint rule under
pkg/linters(following the existing custom-linter pattern in this repo) that flagsfmt.Fprint(ln|f)(os.Stderr, ...)wrapping a non-Stderr-suffixedFormat*call, so new call sites are caught in CI going forward. A separate, larger follow-up issue can track the bulk cleanup if the team decides it's worth doing.Code Region:
pkg/console/console.go(existing*Stderrhelpers),pkg/linters/(new rule)Suggested Agent
Developer (Go linters)
Estimated Effort
Medium (2-4 hours)
Data Source
DeepReport Intelligence Briefing, 2026-10-08 (cycle 3). Source discussion #66843. Live-verified today: the
*Stderrhelpers exist inpkg/console/console.go; mismatch call-site count re-confirmed at ~1,662 via grep (higher than the source report's original count — the gap is still growing).