Open
Description
Problem
We have a monorepo where we want to manage some lints at the workspace level. We also have some CI scripts that set RUSTFLAGS=-Dwarnings
. For crates that set lints.workspace = true
, lint configuration is ignored. I've even tried setting the priority as discussed in #12208 et. al. to no avail.
If I simply set e.g., lints.clippy.useless_format = "allow"
in the specific crates' Cargo.toml
, no warnings-as-errors are emitted.
Steps
- Create a workspace
Cargo.toml
with the content:[workspace.lints.clippy] useless_format = "allow" # or even { level = "allow", priority = -1 }
- Create a crate
Cargo.toml
with content:[lints] workspace = true
- Add some code to trigger the example lint. In our case, it's generated code where almost all strings will have format specifiers and determining otherwise for a few instances didn't seem worth the cost.
fn example() -> String { format!("/some/path") }
- Run the following command. Notice that
clippy::useless_format
warnings-as-errors are still emitted and the command fails.# Also tried on 1.74.0, 1.76.0, and nightly to same effect. # Stable for the repo is 1.74, but system-wide is 1.81 and still repros. RUSTFLAGS=-Dwarnings cargo +stable clippy --workspace
- Change step 2 content to:
[lints.clippy] useless_format = "allow"
- Rust step 4 command again. Notice no errors are emitted.
Possible Solution(s)
No response
Notes
No response
Version
No response