Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--colors and CARGO_TERM_COLORS support #263

Merged
merged 10 commits into from
Jan 26, 2024
Merged

--colors and CARGO_TERM_COLORS support #263

merged 10 commits into from
Jan 26, 2024

Conversation

sourcefrog
Copy link
Owner

@sourcefrog sourcefrog commented Jan 24, 2024

Fixes #178

  • Add --color=always,never,auto
  • Check that colors actually show up in our own CI, with CARGO_TERM_COLORS set
  • Follow NO_COLOR and CLICOLOR_FORCE from https://bixense.com/clicolors/
  • Also follow CARGO_TERM_COLOR
  • Hook this into control of tracing color on stderr
  • Hook this into styling of mutants and findings
  • Test that listings, findings and trace output are styled with colors forced on
  • Check auto looks at isatty: it does, by relying on the logic in the console crate
  • Mention in docs
  • ... including in the CI setup instructions & examples
  • Test interactions of environment variables and options
  • ANSI colors could be on or off independently on stderr and stdout: for example if stdout is redirected to a file then auto colors would be off, but we should still color stderr if it goes to a terminal
  • Clear relevant env vars when running CLI tests so that they're deterministic
  • Update wiki page, or maybe move it into comments or the design doc

See also https://github.com/sourcefrog/cargo-mutants/wiki/Handling-ANSI-colors

image

@sourcefrog sourcefrog changed the title Better control of ANSI colors --colors and CARGO_TERM_COLORS support Jan 26, 2024
@sourcefrog sourcefrog marked this pull request as ready for review January 26, 2024 16:07
@sourcefrog sourcefrog merged commit 9e6d7ec into main Jan 26, 2024
27 checks passed
@sourcefrog sourcefrog deleted the cli-colors branch January 26, 2024 16:11
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.

ANSI colors in CI output
1 participant