8

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?

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
user855
  • 19,048
  • 38
  • 98
  • 162

1 Answers1

4

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.

Lytigas
  • 904
  • 1
  • 7
  • 16