Skip to content

feat: respect the NO_COLOR environment variable - #4

Merged
aloki-alok merged 1 commit into
mainfrom
feat/respect-no-color-env
Jul 30, 2026
Merged

feat: respect the NO_COLOR environment variable#4
aloki-alok merged 1 commit into
mainfrom
feat/respect-no-color-env

Conversation

@aloki-alok

Copy link
Copy Markdown
Contributor

Summary

  • Audited the terminal output code (render.go, spinner.go). It's already well-crafted: careful bonus-vs-fail color logic, progress bars, no false negatives on optional checks.
  • Real gap found: --no-color and TTY detection worked, but the widely adopted NO_COLOR convention (no-color.org, honored by ripgrep, eza, bat, and most modern CLIs) was never checked.
  • Wires NO_COLOR into both the report renderer and the spinner (which previously ignored --no-color entirely and always emitted color codes on a real TTY regardless of the flag).
  • Adds --no-color to crwl fix, which had no way to silence its spinner's color before this (would have errored with "flag provided but not defined" if anyone tried).

Test plan

  • go build, go vet, go test ./... all clean
  • Verified via a real pty (script): a plain run shows \033[1m/\033[31m escape codes; NO_COLOR=1 strips them entirely while output content is byte-identical otherwise

The --no-color flag and TTY detection already worked, but the widely
adopted NO_COLOR convention (no-color.org, honored by ripgrep, eza,
bat) was not checked anywhere. Wires it into both the report renderer
and the spinner, and adds a --no-color flag to `crwl fix`, which had
no way to silence its spinner's color at all before this.
@aloki-alok
aloki-alok merged commit 8fc01ac into main Jul 30, 2026
1 check passed
@aloki-alok
aloki-alok deleted the feat/respect-no-color-env branch July 30, 2026 11:52
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.

1 participant