Skip to content

Conversation

@leops
Copy link
Contributor

@leops leops commented Sep 3, 2021

This PR adds a multiple-versions boolean field to the deny list in bans, allowing the multiple-versions lint level to be set to "allow" or "warn" for all crates and overriding it to "deny" for a chosen few:

[bans]
multiple-versions = "allow"
deny = [
    { name = "naga", multiple-versions = true },
]

Settings both multiple-versions and wrappers is explicitely not supported as I don't think it would make sense, I added an error diagnostic for that specific case that unfortunately required to add a few Option and Spanned wrappers in CrateBan to display the relevant labels. The exact format of the configuration could be different anyway, I simply went with an option that seemed to require only a few changes instead of introducing a completely new deny list specifically for duplicate crates for instance

@leops leops requested a review from Jake-Shadle as a code owner September 3, 2021 08:27
@LukeMathWalker
Copy link

We'd love to have this as well.
We are currently working around the lack of this feature by using multiple deny statements - e.g.

deny = [
    { name = "opentelemetry", version = "<0.14"},
    { name = "opentelemetry", version = ">0.14"}
]

but this requires updating the deny.toml when we update that crate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants