-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add build and test subcommands (binary-emitting Clippy) #15768
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
base: master
Are you sure you want to change the base?
Conversation
9a09c9d
to
1a5823e
Compare
Is the expectation that this is being insta-stabilized? |
The idea of reducing the build time is nice! My experience is that clippy always gets better in each version and enforces more good patterns. As a result, it may fail existing code when bumping the Rust toolchain version. However I am a bit unsure about whether coupling linting with artifact producing / test executions is a best practice. At work I maintain Rust toolchain infrastructure for hundreds of Rust projects. We recommend Rust developers at work not to set I am not sure if these new commands are gonna push more people to tie linting with test executions and artifact producing. I think we should have the message clear about practices we want to recommend. |
To make my above concern less a concern, we might want to have lint levels/configs for type-check and binary-emit commands separately. However it is not possible today through Cargo's |
So, first of all, I'm excited about the idea of avoiding duplication between clippy and compilation. This is an interesting prototype of that. Assuming I'm understanding the architecture correctly here, I would be hesitant to have clippy drive build and test, rather than having build and test drive clippy. I had the impression the goal was to integrate clippy into rustc, rather than having the separate clippy driver start doing builds. The former would be less disruptive to existing compilation mechanisms. |
The expectance is that this will be rolled out slowly and be completely opt-in, we can add an unstable notice for a few versions before committing to a specific style of running the lints. About the lint levels, I assume that we could define a |
clippy-driver doesn’t really change, so the building is still handled by cargo, just that instead of registering the Clippy lints to a Btw, I’d say that priority is against the |
At least For T-cargo, and I assume T-compiler, new CLIs generally start as unstable, requiring a nightly toolchain and a
I'd recommend exercising caution considering 3 different cargo team members, including the one you are quoting as endorsing this work, are skeptical of exposing top-level cargo commands inside of For myself, I'd want to step back and look at the problem more holistically in terms of expected and common workflows, where we want to steer users, and how to best impact those workflows for improving them with work like this. |
Being that currently, if projects want to include Clippy in their testing, it has to be separate from testing and building (which wastes so much CI time, as Clippy and build/test don't share caches), this project adds a
cargo clippy build
andcargo clippy test
subcommandsAlso see #clippy > Clippy but binary-emitting
changelog:Add
cargo clippy build
andcargo clippy test
subcommands