rust-script icon indicating copy to clipboard operation
rust-script copied to clipboard

Clippy mode

Open jayvdb opened this issue 4 years ago • 2 comments

It would be useful to have a clippy mode which runs clippy on the script, ideally clippy args could be supplied (especially as -A has no alternative in a config file).

This could be used to run on purposely "imperfect" code to show the messages that rust compiler/clippy provide for the sample code.

jayvdb avatar May 24 '21 22:05 jayvdb

The just released version 0.23.0 allows using -p/--package to print out the path to the generated package, without any build step.

This allows flexibility, like cargo clippy --manifest-path $(rust-script -p test.rs)/Cargo.toml.

It might still makes sense to have a parameter shortcut for clippy.

fornwall avatar Mar 25 '23 22:03 fornwall

That is a very helpful addition, but using it inside a $(..) makes it unix shell specific. Also as "cargo" and "rust-script" are two commands, to reduce chance of user environment causing odd behaviour it needs to be rustup run stable cargo clippy --manifest-path $(rust-script --toolchain stable -p test.rs)/Cargo.toml.

Something like rust-script --toolchain stable test.rs --clippy -- <clippy args> would be much simpler, and more suitable to put into documentation for users to run to reproduce what the docs are explaining.

jayvdb avatar Mar 26 '23 00:03 jayvdb