-
Notifications
You must be signed in to change notification settings - Fork 46
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
distinguish between normal dependency and dev-dependency #65
Comments
The only info cargo-udeps has access to is "was this library used in the build". And as we are basically doing a dev build of the library, dev-dependencies are included. We'd have to build the library twice, once a dev build to check the dev-dependencies, and once a non-dev build to check any normal dependencies that might only be used as dev-dependencies. It's doable but makes running cargo-udeps a bit slower. |
maybe can add an option like |
You can find such dependencies with [dependencies]
if_chain = "1.0.0"
[dev-dependencies] fn main() {
todo!();
}
#[cfg(test)]
mod tests {
use if_chain as _;
} $ cargo +nightly udeps
Checking aaaaa v0.0.0 (/home/ryo/src/local/scripts/rs/aaaaa)
Finished dev [unoptimized + debuginfo] target(s) in 0.11s
info: Loading save analysis from "/home/ryo/src/local/scripts/rs/target/debug/deps/save-analysis/aaaaa-38d512ac7a9caa23.json"
unused dependencies:
`aaaaa v0.0.0 (/home/ryo/src/local/scripts/rs/aaaaa)`
└─── dependencies
└─── "if_chain"
Note: These dependencies might be used by other targets.
To find dependencies that are not used by any target, enable `--all-targets`.
Note: They might be false-positive.
For example, `cargo-udeps` cannot detect usage of crates that are only used in doc-tests.
To ignore some of dependencies, write `package.metadata.cargo-udeps.ignore` in Cargo.toml.
$ echo "$?"
1 But it may be a good idea to add an option like We can add
|
I use
libc
in unit test and doc example, but not use in codes. When I letlibc
under[dependencies]
, udeps doesn't realize it is unnecessary.Could you make udeps distinguish dependency between normal dependency and dev-dependency so we can write
[dependencies]
more precisely.The text was updated successfully, but these errors were encountered: