Drop --no-color flag in favor of NO_COLOR env var#6
Merged
Conversation
The CLI already auto-detects TTY (suppressing colors when piped) and honors the cross-tool [NO_COLOR](https://no-color.org/) standard. The dedicated `--no-color` flag was redundant — `NO_COLOR=1 emailable …` covers the same use case. Removes the flag, its `ui.SetNoColor` plumbing, related tests, and the dedicated "Color output" README section. `NO_COLOR` stays mentioned in the env vars table.
There was a problem hiding this comment.
Pull request overview
This PR removes the redundant --no-color CLI flag and its plumbing, relying exclusively on the cross-tool NO_COLOR environment variable (plus existing TTY auto-detection) to suppress ANSI styling.
Changes:
- Removed the
--no-colorpersistent flag from the root command and deleted thecmd→uiplumbing that enforced “no color” process-wide. - Simplified
internal/ui.IsTTYby removing the extra forced-disable state, leavingNO_COLORas the only override. - Updated documentation and tests to remove
--no-colorreferences and coverage, while keepingNO_COLORdocumented.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Removes the dedicated “Color output” section and updates the env var table to describe NO_COLOR without referencing the deleted flag. |
| internal/ui/spinner.go | Deletes SetNoColor / forced no-color state; IsTTY now only honors NO_COLOR and terminal detection. |
| internal/ui/spinner_test.go | Removes tests specific to SetNoColor / forced flag-driven behavior. |
| internal/output/human.go | Updates comments to reflect NO_COLOR as the only styling suppressor via ui.IsTTY. |
| cmd/verify_test.go | Removes tests and imports related to --no-color. |
| cmd/testutil_test.go | Removes test environment resets for the deleted noColor flag state. |
| cmd/root.go | Drops the --no-color flag and the PersistentPreRunE propagation to ui.SetNoColor. |
| cmd/root_test.go | Updates help-surface tests to stop expecting --no-color; removes propagation test. |
| cmd/context.go | Removes NoColor from cmdCtx and updates related comments. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
The CLI already auto-detects TTY (suppressing colors when piped) and honors the cross-tool NO_COLOR standard. The dedicated
--no-colorflag was redundant —NO_COLOR=1 emailable …covers the same use case.Removes the flag, its
ui.SetNoColorplumbing, related tests, and the dedicated "Color output" README section.NO_COLORstays mentioned in the env vars table.