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 setting lints.workspace as false #13821

Open
Kriskras99 opened this issue Apr 28, 2024 · 5 comments
Open

Allow setting lints.workspace as false #13821

Kriskras99 opened this issue Apr 28, 2024 · 5 comments
Labels
A-lints-table Area: [lints] table A-workspace-inheritance Area: workspace inheritance RFC 2906 C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage.

Comments

@Kriskras99
Copy link

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 rust-lang/rust-clippy#11933.

Proposed Solution

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

Notes

No response

@Kriskras99 Kriskras99 added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage. labels Apr 28, 2024
@heisen-li
Copy link
Contributor

@rustbot label +A-lints-table

@rustbot rustbot added the A-lints-table Area: [lints] table label Apr 29, 2024
@epage epage added the A-workspace-inheritance Area: workspace inheritance RFC 2906 label Apr 29, 2024
@epage
Copy link
Contributor

epage commented Apr 29, 2024

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.

@Kriskras99
Copy link
Author

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.

@epage
Copy link
Contributor

epage commented Apr 29, 2024

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 rust-lang/rust-clippy#11933 (comment)

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

From #13821 (comment)

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
Copy link
Contributor

epage commented Apr 29, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints-table Area: [lints] table A-workspace-inheritance Area: workspace inheritance RFC 2906 C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

4 participants