Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clippy mode #22

Open
jayvdb opened this issue May 24, 2021 · 2 comments
Open

Clippy mode #22

jayvdb opened this issue May 24, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@jayvdb
Copy link

jayvdb commented May 24, 2021

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.

@fornwall fornwall added the enhancement New feature or request label Jul 10, 2021
@fornwall
Copy link
Owner

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.

@jayvdb
Copy link
Author

jayvdb commented Mar 26, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants