You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Limit to specific package in workspace, also excluding its dependencies #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.
Reacted by Siddhartha Sahu, Ellie, blakehawkins, Armin, Michael Leonhard and Reilly Wood
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 cargo clean supposedly supports the -p flag.
cargo check suffers from the same problem. The problem is that cargo does not distinguish between local dependencies inside our outside of the workspace. For both --cap-lints=allow is not set like it is for remote dependencies. This results in cargo check complaining about all lints in local packages. See rust-lang/cargo#5998
Activity
oli-obk commentedon Aug 13, 2018
We're reusing
cargo checkinfrastructure. Can you check whethercargo checkhas the same issue?sanmai-NL commentedon Aug 13, 2018
How could I best verify that? This suggests
cargo checkhas the same issue, no?dotellie commentedon Nov 11, 2018
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 😅
hcpl commentedon Nov 12, 2018
@magnonellie I think you used
clippyfrom stable which doesn't supportclippy::lintsyntax, onlylint. Beta and nightly should support that now.mykmelez commentedon Mar 29, 2019
A workaround appears to be (assuming
PACKAGEandPATH_TO_PACKAGEare set appropriately):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
cargo cleansupposedly supports the-pflag.geigerzaehler commentedon Oct 21, 2019
cargo checksuffers from the same problem. The problem is that cargo does not distinguish between local dependencies inside our outside of the workspace. For both--cap-lints=allowis not set like it is for remote dependencies. This results incargo checkcomplaining about all lints in local packages. See rust-lang/cargo#5998Auto merge of #6188 - ebroto:primary_package, r=Manishearth
Auto merge of #6188 - ebroto:primary_package, r=flip1995
FIX: Cargo check warnings and some clippy lints
FIX: Cargo check warnings and some clippy lints