-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Allow tool lint levels to be set based on the build environment. #109063
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
Conversation
r? @TaKO8Ki (rustbot has picked a reviewer for you, use r? to override) |
Please don't allow this to be set based on arbitrary env variables or cfgs. Add a |
I wonder if default level should be something that is set when registering the lint rather than in the static lint definition. It seems weird to have it work this way, perhaps we should rethink that architecture? We can still have the convenience API and macro. It does seem like doing arbitrary things based on, e.g. clippy.toml, may be useful here. |
Not opposed to allowing these to be set based on clippy.toml (although maybe it makes sense to have a compiler MCP for that?) but the current PR doesn't allow that, it only allows setting it based on the build configuration, not any file at runtime. |
To the extent possible, we try to avoid stability affecting anything except whether feature gates can be turned on or off. Doing so means that checking something against nightly (e.g. for bisecting) is more problematic, and also increases the chances that we need to do work during bootstrap bumps (e.g., because lints are now causing errors in tools or similar). So I think this needs stronger motivation than I'm currently aware of. |
@jyn514 Yes, I'm proposing an alternate approach here where lints do not store their default level on the type anymore, it's a part of the process of registering. I think that's a cleaner approach — I do not see a strong reason for the default level to be a part of the I think it's a bit more principled and clean. |
But I do think any change to this is probably MCP worthy (and then we can properly discuss potential approaches for implementation) Things to discuss:
without nailing down particular Clippy plans |
☔ The latest upstream changes (presumably #112038) made this pull request unmergeable. Please resolve the merge conflicts. |
The group membership should also be controlled as part of this PR. Otherwise, it could happen that |
Closing this as this requires an MCP that hasn't been created and there has been no activity on this. |
Changes to allow tool lints to have their default lint level determined by the current build type. Allows using:
There's still the question of whether this is the best way to go about this.
cc @rust-lang/clippy