-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Limit to specific package in workspace, also excluding its dependencies #3025
Comments
We're reusing |
How could I best verify that? This suggests cargo check -p package_in_workspace_2
|
Is this issue being worked on? We currently can't run clippy on Amethyst because we have dependencies using experimental clippy features.
... is just an example of one of the many errors we get by default. If this is an unrelated error then I apologize but I would still be happy for someone to point me in the right direction 😅 |
@magnonellie I think you used |
A workaround appears to be (assuming
I would have thought this would work:
But clippy doesn't seem to check the package in that case (at least it doesn't warn me about any problems in it), even though |
|
Add --no-deps option to avoid running on path dependencies in workspaces Since rust-lang/cargo#8758 has hit nightly, this allows us to address the second bullet point and [the concern related to `--fix`](rust-lang/cargo#8143 (comment)) in the [RUSTC_WORKSPACE_WRAPPER tracking issue](rust-lang/cargo#8143). As a reminder stabilizing that env var will solve #4612 (Clippy not running after `cargo check` in stable) and would allow to stabilize the `--fix` option in Clippy. changelog: Add `--no-deps` option to avoid running on path dependencies in workspaces Fixes #3025
Clippy lints cannot be fixed by the packages that import the library reiimplementations directly, this is a known problem. See rust-lang/rust-clippy#3025.
Clippy lints cannot be fixed by the packages that import the library reiimplementations directly, this is a known problem. See rust-lang/rust-clippy#3025.
Running Clippy on a specific package in a workspace with
cargo clippy -p package_in_workspace
works, thanks to #2585. It appears, however, that this does not exclude dependency crates within the same workspace. So if these deps cause any Clippy errors, compilation will be aborted and the targeted package won’t be checked. That’s a hindrance for gradually resolving Clippy suggestions across a large code base in a workspace.The text was updated successfully, but these errors were encountered: