I have a workspace with many crates. I want to run cargo clippy
only one of of them them and not any of its dependencies.
How do I accomplish this?
I have a workspace with many crates. I want to run cargo clippy
only one of of them them and not any of its dependencies.
How do I accomplish this?
I'm assuming based on your mention of a workspace that cargo clippy --package mypackage
is wrongfully running on a path dependency of mypackage
within the workspace.
Wrongful linting of path dependencies in workspaces is a known issue. Progress has been slow. Having looked deep into the trenches of GitHub issues, I'd say the best place to track this right now is this clippy issue, which is blocked by this cargo issue.
This has been ongoing for a long time, too. This issue originally reports it and a fix is made in clippy-preview
, while the fix isn't possible for "normal" clippy. This issue tracks migrating everyone to clippy-preview
. But after much discussion, these integration plans are abandoned for a new method, that abandons clippy-preview
entirely which finally brings us to the state of matters today: the way that clippy interacts with cargo and rustc to do what it does needs to change to support this feature.