Skip to content

[workspace.lints.clippy] cannot override a category "warn" with a lint specific "allow" #12716

Closed
@Kriskras99

Description

@Kriskras99

Summary

I like to set categories as "warn" or "deny", and then allow specific lints. For example "warn" on cargo lints, but "allow" the multiple_crate_versions.
Currently this does not work, and I have to add an override when running Clippy on the command line

Reproducer

I tried this code:

[workspace.lints.clippy]
cargo = "warn"
multiple_crate_versions = "allow"

I expected to see this happen:
Warnings for cargo lints, but not for multiple_crate_versions

Instead, this happened:

warning: multiple versions for dependency `hashbrown`: 0.12.3, 0.14.3
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions

warning: multiple versions for dependency `indexmap`: 1.9.3, 2.2.6
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions

warning: multiple versions for dependency `regex-automata`: 0.1.10, 0.4.6
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions

warning: multiple versions for dependency `regex-syntax`: 0.6.29, 0.8.3
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions

warning: multiple versions for dependency `strsim`: 0.10.0, 0.11.1
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions

Version

rustc 1.79.0-nightly (ef8b9dcf2 2024-04-24)
binary: rustc
commit-hash: ef8b9dcf23700f2e2265317611460d3a65c19eff
commit-date: 2024-04-24
host: x86_64-unknown-linux-gnu
release: 1.79.0-nightly
LLVM version: 18.1.4

Additional Labels

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions