Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

parse cargo.toml to get a list of available features #14

Open
o0Ignition0o opened this issue Nov 29, 2019 · 1 comment
Open

parse cargo.toml to get a list of available features #14

o0Ignition0o opened this issue Nov 29, 2019 · 1 comment
Labels
help wanted Extra attention is needed
Milestone

Comments

@o0Ignition0o
Copy link
Owner

In order to enable the correct features for each subcrate, cargo-scout should be able to get a list of available features, and intersect with a list of enabled features to run clippy with the correct set (and not add any feature that is not available)

Examples:

Example 1

crate has a feature named bar
cargo-scout is invoked as cargo-scout --features "foo bar"

command run

clippy should be run with the bar feature only.

Example 2

crate is in a workspace, has first subcrate named foo, a second named bar, and both define a feature named baz.

command run

cargo scout is invoked ad cargo-scout is invoked as cargo-scout --features "baz"

Both clippy commands must add the feature baz.

command run

cargo-scout is invoked as cargo-scout --features "foo/baz"

the feature baz should only be added to the clippy check on subcrate foo.

@o0Ignition0o o0Ignition0o added this to the clippy flags milestone Nov 29, 2019
@o0Ignition0o
Copy link
Owner Author

https://docs.rs/cargo_toml/0.8.0/cargo_toml/struct.Manifest.html can help a lot on finding out the features !

@o0Ignition0o o0Ignition0o added the help wanted Extra attention is needed label Dec 10, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant