Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Is there a way to invert the order clippy/rustc? #966

Open
frederikhors opened this issue Oct 30, 2022 · 1 comment
Open

Is there a way to invert the order clippy/rustc? #966

frederikhors opened this issue Oct 30, 2022 · 1 comment

Comments

@frederikhors
Copy link

I'm using this in VSCode settings.json:

{
  "rust-analyzer.checkOnSave.command": "clippy",
}

it works good.

But I would like to have rustc errors before and only after the clippy errors/warnings because sometimes clippy can take many more seconds than rustc.

Is there a way to invert the order?

@lnicola
Copy link
Member

lnicola commented Oct 31, 2022

The right repository to file this would be https://github.com/rust-analyzer/rust-analyzer.

We show the diagnostics as returned by cargo clippy, which happen to include the ones from rustc. I don't think we can really distinguish them:

warning: long literal lacking separators
  --> src/vector/defn.rs:18:16
   |
18 | const X: i32 = 1000000000;
   |                ^^^^^^^^^^ help: consider: `1_000_000_000`
   |
   = note: requested on the command line with `-W clippy::unreadable-literal`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unreadable_literal

warning: unused variable: `s`
  --> src/vector/defn.rs:26:13
   |
26 |         let s = 2;
   |             ^ help: if this is intentional, prefix it with an underscore: `_s`
   |
   = note: `#[warn(unused_variables)]` on by default

I suggest running clippy only from time to time, not on every file save. I even disable cargo check in favour of the native diagnostics.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants