-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
cargo-clippy unconditionally runs lints for path dependencies #1066
Comments
Clippy seems to be running on all path dependencies again, reopen this issue? |
It seems that Clippy looks for the argument |
That's just a hack to detect that we're in the final I want to build a general way for custom drivers to be run on the final crate only (and without such flag parsing hacks), but I haven't gotten around to it. |
A general way would be super useful for custom drivers! I'm also looking for a reliable solution for a driver that we are building, so if I find something useful I'll share. By the way, is that the only check? Looking at the ~/git/regex$ cargo clean && cargo +nightly check --verbose
|
I'm not sure if this is related but it seems like it might be so I'm gonna leave this info here in case it helps. I have this project https://github.com/yaahallo/gameoff where if I run stable clippy it errors out on some of the dependencies
Notably, my project is split into multiple crates in a workspace using a path dependency from the lib crate to the binary crate. I wouldn't expect clippy to run lints on any of my dependencies (other than the path one). I tried running clippy specifically from the lib crate This leads me to believe it's not related to the fact that its a path dependency, and I'm not honestly sure clippy isn't expected to lint every dependency. But it seemed weird so I figured I'd bring it up. |
I'm experiencing the same behavior even on latest nightly |
Cargo tries to lint all of the path dependencies, so it's disabled for now rust-lang/rust-clippy#1066
Ran into this today, and found it very surprising. |
The permanent fix for this is #3837, once we have that we can customize this behavior in cargo. |
If this is still the problem blocking fixing this, then there is a solution to use the Cargo API - there is a |
This is fixed on latest master of cargo for |
Ooh god, I accidentally fixed an issue I participated in a year earlier without even knowing. What are the chances... |
I think there's been a regression cargo-clippy --version
clippy 0.0.212 (c8e3cfb 2019-10-28) |
You have to use |
I'm using
I have a project with one path dependency ( |
I'm seeing the same thing as @notoria. Am I missing something?
|
@ryanavella Use |
Say we have this project:
Cargo.toml:
src/lib.rs:
foodep/Cargo.toml:
foodep/src/lib.rs:
When I run
cargo clippy --features=clippy
onfoodep
, it compiles without warnings, because of the conditionalallow(enum_variant_names)
.However, when I run
cargo clippy --features=clippy
onhaspathdep
, it also runs the clippy lints forfoodep
, but without taking into consideration that I have enabled--features=clippy
.The text was updated successfully, but these errors were encountered: