libs/cmdio: centralize lipgloss renderer initialization - #5903
Merged
Conversation
Add cmdio.NewRenderer(ctx, w), which builds a lipgloss renderer and forces the Ascii profile when the writer has no color, so callers no longer repeat the NewRenderer + SetColorProfile(Ascii) dance. This makes cmdio the sole importer of muesli/termenv, so promote it from an indirect to a direct dependency (with its NOTICE entry) and pin it here. Co-authored-by: Isaac
Collaborator
Integration test reportCommit: b3a73dd
8 interesting tests: 4 SKIP, 2 RECOVERED, 2 flaky
Top 10 slowest tests (at least 2 minutes):
|
pietern
enabled auto-merge
July 13, 2026 10:00
janniklasrose
approved these changes
Jul 13, 2026
Collaborator
Integration test reportCommit: 3713667
27 interesting tests: 17 FAIL, 5 RECOVERED, 2 flaky, 2 SKIP, 1 KNOWN
Top 50 slowest tests (at least 2 minutes):
|
riddhibhagwat-db
added a commit
that referenced
this pull request
Jul 14, 2026
PR #5914 added a ruleguard rule banning direct lipgloss.NewRenderer calls in favor of cmdio.NewRenderer (added in #5903), which centralizes the color-profile handling. Switch air's render.go and list_tui.go (and their tests) to the helper; it applies the same Ascii-profile-when-no-color logic the air code was doing by hand, so output is unchanged. Tests pass the renderer a cmdio.MockDiscard context since NewRenderer reads cmdIO from it. Co-authored-by: Isaac
ronaldz-db
pushed a commit
to ronaldz-db/cli
that referenced
this pull request
Jul 15, 2026
…ks#5914) Follow-up to databricks#5903, which introduced `cmdio.NewRenderer(ctx, w)`. This adopts it at the call sites: route the hardcoded spinner and table `lipgloss.NewStyle()` sites through `cmdio.NewRenderer(ctx, w)`, so the color-profile decision flows from the target writer instead of lipgloss's package-global default renderer. Threading `ctx` to `tableview.Run` extends the postgres `rowSink.End` signature. Also add a ruleguard lint that rejects direct `lipgloss.NewRenderer` calls outside `libs/cmdio`, keeping construction funneled through the wrapper. This pull request and its description were written by Isaac.
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.
Add
cmdio.NewRenderer(ctx, w), which builds alipgloss.Rendererand forces the Ascii profile when the writer has no color, returning the renderer plus the resolvedcolorOnbool. Callers stop repeating theNewRenderer+SetColorProfile(termenv.Ascii)dance.This makes
cmdiothe sole importer ofmuesli/termenv, so it's promoted from indirect to a direct dependency (withNOTICEentry).This pull request and its description were written by Isaac.