0

I altered the linting messages in Clippy by forking the Clippy repo and changing for example "clippy_lints/no_panics.rs" to alter the message shown when clippy is not told what to do in the presence of panicking code. (my real use case requires more, but it also needs at least what I described now)

  • I forked the Clippy repo to a folder called clippy-clone.
  • I run cargo build which creates two binaries cargo-clippy.exe and clippy-driver.exe.

Now running this cargo-clippy (with target\debug\cargo-clippy) in the forked clippy folder seems to work as intended: it shows my changed lint message.

Now I want to use my own clippy version on some other folder.

  • I traverse to that folder (sibling of the clippy clone)
  • I run ..\clippy-clone\target\debug\cargo-clippy

It errors and gives:

PS C:\Users\sibling-dir> ..\clippy-clone\target\debug\cargo-clippy    
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `C:\Users\clippy-clone\target\debug\clippy-driver.exe rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 0xc0000135, STATUS_DLL_NOT_FOUND)

So how do I built this fork properly and run it as a standalone application from any cargo project folder on my pc? I'm assuming it has something to do with other files (besides cargo-clippy.exe) not being present, but for example the real clippy can also be run from every folder, I want this same behaviour.

The Coding Wombat
  • 805
  • 1
  • 10
  • 29
  • 1
    https://doc.rust-lang.org/nightly/clippy/development/basics.html#install-from-source – PitaJ Oct 05 '22 at 17:14
  • @PitaJ that seems interesting and useful already, thank you. However, I would want to be able to run it as a differently named program later on, and also still be able to use clippy. This approach seems to replace the real clippy in the toolchain. – The Coding Wombat Oct 05 '22 at 18:14

0 Answers0