简体   繁体   English

如何阻止`cargo clippy` 也运行依赖项?

[英]How to stop `cargo clippy` from running on dependencies as well?

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.我想运行cargo clippy只是他们其中的一个,并没有任何相关性。

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.我假设根据您提到的工作区, cargo clippy --package mypackage错误地在工作区中mypackage的路径依赖项上运行。

Wrongful linting of path dependencies in workspaces is a known issue.工作区中路径依赖的错误 linting 是一个已知问题。 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 .在深入研究了 GitHub 问题的战壕后,我想说现在跟踪这个问题的最佳位置是这个这个货物问题阻止的棘手问题


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.此问题最初报告并在clippy-preview中进行了修复,而“普通”clippy 无法修复。 This issue tracks migrating everyone to clippy-preview .此问题跟踪将每个人迁移到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.但是经过多次讨论,这些集成计划一种新方法放弃了该方法完全放弃了clippy-preview最终将我们带到了今天的状态:clippy 与 cargo 和 rustc 交互的方式来做它需要改变的事情支持这个功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM