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

fix: Improve color env variable support #688

Merged
merged 1 commit into from Mar 15, 2023
Merged

Conversation

epage
Copy link
Collaborator

@epage epage commented Mar 15, 2023

  • CLICOLOR=1 now works correctly
  • NO_COLOR= now works correctly
  • Auto-enable colors in CI

For running typos on the Linux kernel (176,210 typos to be printed), we went from 20.082s to <20.450s. Where in that range is unclear due to jitter in my system.

$ hyperfine -L typos ./typos-main,./typos-anstream "{typos} ../../../linux" -i
Benchmark 1: ./typos-main ../../../linux
  Time (mean ± σ):     20.082 s ±  0.111 s    [User: 39.668 s, System: 0.474 s]
  Range (min … max):   19.961 s … 20.331 s    10 runs

  Warning: Ignoring non-zero exit code.

Benchmark 2: ./typos-anstream ../../../linux
  Time (mean ± σ):     20.426 s ±  0.104 s    [User: 40.301 s, System: 0.523 s]
  Range (min … max):   20.316 s … 20.661 s    10 runs

  Warning: Ignoring non-zero exit code.

Summary
  './typos-main ../../../linux' ran
    1.02 ± 0.01 times faster than './typos-anstream ../../../linux'

$ CLICOLOR_FORCE=1 hyperfine -L typos ./typos-anstream "{typos} ../../../linux" -i
Benchmark 1: ./typos-anstream ../../../linux
  Time (mean ± σ):     20.262 s ±  0.075 s    [User: 39.961 s, System: 0.542 s]
  Range (min … max):   20.154 s … 20.420 s    10 runs

  Warning: Ignoring non-zero exit code.

$ CLICOLOR=0 hyperfine -L typos ./typos-anstream "{typos} ../../../linux" -i
Benchmark 1: ./typos-anstream ../../../linux
  Time (mean ± σ):     20.296 s ±  0.065 s    [User: 40.003 s, System: 0.565 s]
  Range (min … max):   20.169 s … 20.383 s    10 runs

  Warning: Ignoring non-zero exit code.

- `CLICOLOR=1` now works correctly
- `NO_COLOR=` now works correctly
- Auto-enable colors in CI


For running `typos` on the Linux kernel (176,210 typos to be printed), we went from 20.082s to
<20.450s.  Where in that range is unclear due to jitter in my system.
```console
$ hyperfine -L typos ./typos-main,./typos-anstream "{typos} ../../../linux" -i
Benchmark 1: ./typos-main ../../../linux
  Time (mean ± σ):     20.082 s ±  0.111 s    [User: 39.668 s, System: 0.474 s]
  Range (min … max):   19.961 s … 20.331 s    10 runs

  Warning: Ignoring non-zero exit code.

Benchmark 2: ./typos-anstream ../../../linux
  Time (mean ± σ):     20.426 s ±  0.104 s    [User: 40.301 s, System: 0.523 s]
  Range (min … max):   20.316 s … 20.661 s    10 runs

  Warning: Ignoring non-zero exit code.

Summary
  './typos-main ../../../linux' ran
    1.02 ± 0.01 times faster than './typos-anstream ../../../linux'

$ CLICOLOR_FORCE=1 hyperfine -L typos ./typos-anstream "{typos} ../../../linux" -i
Benchmark 1: ./typos-anstream ../../../linux
  Time (mean ± σ):     20.262 s ±  0.075 s    [User: 39.961 s, System: 0.542 s]
  Range (min … max):   20.154 s … 20.420 s    10 runs

  Warning: Ignoring non-zero exit code.

$ CLICOLOR=0 hyperfine -L typos ./typos-anstream "{typos} ../../../linux" -i
Benchmark 1: ./typos-anstream ../../../linux
  Time (mean ± σ):     20.296 s ±  0.065 s    [User: 40.003 s, System: 0.565 s]
  Range (min … max):   20.169 s … 20.383 s    10 runs

  Warning: Ignoring non-zero exit code.
```
@epage epage merged commit 29e640b into crate-ci:master Mar 15, 2023
11 of 12 checks passed
@epage epage deleted the anstream branch March 15, 2023 14:23
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.

None yet

1 participant