cargo icon indicating copy to clipboard operation
cargo copied to clipboard

Allow setting `lints.workspace` as `false`

Open Kriskras99 opened this issue 9 months ago • 5 comments

Problem

I expect to be able to set lints.workspace to false to explicitly opt out of the workspace lints. Currently this is not allowed.

It would also be helpful for a potential lint like https://github.com/rust-lang/rust-clippy/issues/11933.

Proposed Solution

Treat lints.workspace = false the same as not setting it at all.

Notes

No response

Kriskras99 avatar Apr 28 '24 13:04 Kriskras99

@rustbot label +A-lints-table

heisen-li avatar Apr 29 '24 03:04 heisen-li

Posted on rust-lang/rust-clippy#11933 with a framing that might not need this.

If we went down this route, we'd need to decide if we should mirror this in all of the rest of workspace inheritance.

epage avatar Apr 29 '24 14:04 epage

I have actually tried setting workspace to false, before knowing about the lint idea. It just feels natural to disable the workspace lints by setting it to false. I thought it would be as simple as just allowing it and basically ignoring it, but if it also impacts other workspace stuff, then it would need some more consideration.

Kriskras99 avatar Apr 29 '24 15:04 Kriskras99

The following statements make me suspect its best if we don't support workspace = false for now as it seems like people could do it and get the wrong impression as to what it does

From https://github.com/rust-lang/rust-clippy/issues/11933#issuecomment-1877762065

Oh my gosh, I thought/hoped that this is implicitly on without having to opt in for every workspace member crate. 😱

From https://github.com/rust-lang/cargo/issues/13821#issuecomment-2082997392

I have actually tried setting workspace to false, before knowing about the lint idea. It just feels natural to disable the workspace lints by setting it to false.

epage avatar Apr 29 '24 15:04 epage

I thought it would be as simple as just allowing it and basically ignoring it, but if it also impacts other workspace stuff, then it would need some more consideration.

We could allow it and it would ignore it. However, all of workspace inheritance works the same way and has the same behavior of disallowing workspace = false so we'd at least need to evaluate how important consistency is and what it would be like to support workspace = false in the other places.

epage avatar Apr 29 '24 15:04 epage