Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support FORCE_COLOR env var (#10839)
Fixes #5499 ## Summary Add support for `FORCE_COLOR` env var, as specified at https://force-color.org/ ## Test Plan I wrote an integration test for this, and then realized that can't work, since we use a dev-dependency on `colored` with the `no-color` feature to avoid ANSI color codes in test snapshots. So this is just tested manually. `cargo run --features test-rules -- check --no-cache --isolated - --select RUF901 --diff < /dev/null` shows a colored diff. `cargo run --features test-rules -- check --no-cache --isolated - --select RUF901 --diff < /dev/null | less` does not have color, since we pipe it to `less`. `FORCE_COLOR=1 cargo run --features test-rules -- check --no-cache --isolated - --select RUF901 --diff < /dev/null | less` does have color (after this diff), even though we pipe it to `less`.
- Loading branch information