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

Add --all flag for a workspace #1707

Closed
Nemo157 opened this issue Apr 29, 2017 · 4 comments
Closed

Add --all flag for a workspace #1707

Nemo157 opened this issue Apr 29, 2017 · 4 comments
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages

Comments

@Nemo157
Copy link
Member

Nemo157 commented Apr 29, 2017

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 running clippy over all crates in the current workspace.

@mcarton mcarton added the C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages label Apr 29, 2017
@crumblingstatue
Copy link

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.

@BenjaminGill-Metaswitch

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 cargo build --all), which should (?) speed things up. I don't know how to do this, however.

@oli-obk
Copy link
Contributor

oli-obk commented Aug 22, 2017

This flag exists now (on master, not published yet). I'm leaving this issue open for the parallelization

@mathstuf
Copy link
Contributor

mathstuf commented Nov 8, 2017

The flag does exist, but I'm seeing that if I manually add warn(lint) attributes to a dependent crate, it is marked as an unknown lint. Running each crate individually gets around this.

bjgill added a commit to bjgill/rust-clippy that referenced this issue Mar 28, 2018
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages
Projects
None yet
Development

No branches or pull requests

6 participants