Skip to content
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

Allow banning multiple versions of a specific crate #365

Closed
wants to merge 1 commit into from

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

@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