rust-lang / rust-lang/rust-clippy

Should we lint things that would get fixed by rustfmt anyway?

Open
#793 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

rustfmt would/(will?) reorder the following to move all the uses to the top.

use a::b;
fn bla() {}
use x::y;

We could of course lint on such things, but people might end up having to reconfigure both rustfmt and clippy for their projects, because the one moves something around that clippy then lints about.

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

Start with the rustfmt ordering example and inspect the relevant Clippy lint behavior and configuration. Determine whether Clippy should lint code that rustfmt would reorder, including whether users would need conflicting rustfmt and Clippy settings; the work is done when that policy and its expected behavior are clearly established.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.