rust-lang / rust-lang/rust-clippy

Clippy has no --color option

Open
#8,044 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-ui C-enhancement
Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Description

Similar to other cargo tooling and cargo itself there should be a --color=always/never option for clippy.

I have situation where I'd like to pipe clippy into other programs and preserve the colors. But I see no way of achieving that.

Example bash: cargo test -- --color=always |& less preserves colors but cargo clippy -- --color=always |& less fails and just cargo clippy |& less strips colors.

@ rustbot label +C-enhancement

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported commands with cargo clippy and compare their color behavior with cargo test. Start by tracing Clippy's command-line option handling and the existing cargo color behavior; done means --color=always and --color=never work when output is piped, with colors preserved or suppressed as requested.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.