-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add --all flag for a workspace #1707
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
Comments
I'd just like to mention that rustfmt (cargo-fmt) implements this, and it even works for virtual workspaces. Maybe it could be looked at for implementation clues. |
A minimal version of this should be fairly simple - just loop over all packages in the workspace, rather than picking one (https://github.com/rust-lang-nursery/rust-clippy/blob/master/src/main.rs#L268). That should work (I'll look at submitting a PR in the fortnight, unless anyone objects). However, given that it would be running the builds in serial, it's not going to be very fast. It would be nice to be able to compile the various crates in parallel (like |
This flag exists now (on master, not published yet). I'm leaving this issue open for the parallelization |
The flag does exist, but I'm seeing that if I manually add |
Now that we're using cargo check, we can stop needing to find out the manifest path ourselves. Instead, we can delegate to cargo check, which is perfectly capable of working out for itself what needs to be built. This fixes rust-lang#1707 and rust-lang#2518. Note that this PR will change the output. We will no longer output `bin: foo` before each crate. This a bit unfortunate. However, given that we're now going to be building in parallel (which is *much* faster), I think this is acceptable - we'll be no worse than cargo itself.
I will add that this seems to "fail fast" i.e. if there are clippy errors with an one workspace member, it will not lint other members of the workspace. Is there a flag to continue on inter dependencies clippy errors? (as they are only linter errors and the others crates should still compile) |
That would need to be a cargo feature. The same thing happens if you deny a rustc lint while running |
Is there an open issue over there that I can follow? |
I'm not aware of any particular open issue to follow, but there is probably something similar if you search. |
Currently it looks like the only way to run
cargo clippy
on a workspace is to manually run it on each crate. It would be super helpful if the standard--all
flag were supported for runningclippy
over all crates in the current workspace.The text was updated successfully, but these errors were encountered: