Skip to content

Drop --no-color flag in favor of NO_COLOR env var#6

Merged
jclusso merged 1 commit into
masterfrom
drop-no-color-flag
May 26, 2026
Merged

Drop --no-color flag in favor of NO_COLOR env var#6
jclusso merged 1 commit into
masterfrom
drop-no-color-flag

Conversation

@jclusso
Copy link
Copy Markdown
Member

@jclusso jclusso commented May 26, 2026

The CLI already auto-detects TTY (suppressing colors when piped) and honors the cross-tool NO_COLOR 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.

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.
Copilot AI review requested due to automatic review settings May 26, 2026 15:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-color persistent flag from the root command and deleted the cmdui plumbing that enforced “no color” process-wide.
  • Simplified internal/ui.IsTTY by removing the extra forced-disable state, leaving NO_COLOR as the only override.
  • Updated documentation and tests to remove --no-color references and coverage, while keeping NO_COLOR documented.

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.

@jclusso jclusso merged commit 4f6f96e into master May 26, 2026
4 checks passed
@jclusso jclusso deleted the drop-no-color-flag branch May 26, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants