TheBevyFlock / flag-frenzy

Check combinations of Bevy's feature flags
Apache License 2.0
4 stars 1 forks source link

separate used and unused optional dependencies. #23

Open nihohit opened 6 days ago

nihohit commented 6 days ago
[dependencies]
simple = { path = "../simple", optional = true }
empty = { path = "../empty", optional = true }

[features]
feature1= ["simple"]

The simple dependency is used by the feature1 feature, and the empty dependency is unused by all features. Can we add a configuration that is a midway between disabling all optional dependencies and enabling all optional dependencies, to only check the unused optional dependencies? It's roughly the equivalent of adding empty = [] or empty = ["dep:empty"] to the configuration.

The rationale behind this is that optional dependencies that are used by features are probably not meant to be consumed as features, while optional dependencies that are unused are probably used in the code as [cfg(feature = "empty")] (otherwise, why are they there?). This isn't certain, so I suggest leaving this to the user to configure whether to make this assumption or not.