-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Expose lint levels from CLI #14522
Comments
Is #8424 sufficient for this use case? |
For that specific use case yes, it is. But there is also at least one different use case. |
Could you elaborate on that? I'm not seeing it mentioned in the issue and we'd need to understand requirements to be able to discuss designs. |
Basically I need |
For me, the question is if |
Maybe it's other way around. If there's use case for |
Yes, we would handle all of those together. The point I was raising was whether there is enough of a use case for those general flags to exist in Cargo's CLI. |
I run The status quo here is mostly okay, but that extra |
I wonder if that case would be another use case for a new lint level which I proposed at https://internals.rust-lang.org/t/forbid-deny-warn-allow-and-notice/19986 |
Maybe if you really, really don't want to pollute CLI, a different way to solve these issues would be to have something like |
For myself, that seems strange for publish to change like that and calls out a good complication to having an "override": it complicates provenance for that crate itself. |
Problem
There are cases when it's not desirable configuring the lint levels using
Cargo.toml
andRUST(DOC)FLAGS
is not discoverable and also has the footgun thatRUSTFLAGS
!=RUSTDOCFLAGS
. Specifically it's useful to have things like#![warn(missing_docs)]
in thelib.rs
but deny the warning in the CI because it's annoying to have to document everything if one is just designing the API and manually editing the file (potentially accidentally committing it) is also annoying. EditingCargo.toml
from CI's shell script is fragile.Proposed Solution
It'd be best to just expose the lint levels from
cargo
and make surecargo
sets them correctly for rustc and rustdoc. Also please don't forget forbid because that level is also useful and even if it's not super-important it'll be probably just a few more lines once other lint levels are in.Notes
I've opened this as requested in #12739 (comment)
The text was updated successfully, but these errors were encountered: