-
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
cargo --config
doesn't (seem) to work with lints.*
#13018
Comments
|
Here is the strategy rust-lang/cargo itself uses currently. Set lint rules for development in Lines 109 to 121 in 71cd3a9
cargo/.github/workflows/main.yml Line 69 in 71cd3a9
|
Okay so if I understand correctly, It does not mean that there is a table with lints named |
Not exactly. For To set rustc built-in lints in [lints.<tool>]
lint-rule-name = "<level>" I am going to close this, as it is not about bugs in Cargo. Feel free to open new issues for any doc enhancement idea. |
Clarification: setting that in CI is the recommended way but you likely want to pin to a specific rust release. I use my MSRV. |
Problem
I'm trying to set up a separate linting strategy for local development with everything as a warning, but still allow me to compile. Who cares about dead code / unused imports when I'm iterating over a feature? I'll tidy up later.
But on the the CI I want things dialed up to the max.
With the release of
lints
support in Rust 1.74 I've been trying to get it to work together with--config <PATH>
/--config KEY=VALUE
, and I've not been successful.Steps
cargo new lint-config
src/main.rs
:ci.toml
:cargo --config "lints.rust.non_ascii_idents = \"deny\"" build
cargo --config lints.rust.non_ascii_idents=\"deny\" build
cargo --config "lints.rust.non_ascii_idents='deny'" build
cargo --config 'lints.rust.non_ascii_idents="deny"' build
cargo --config ci.toml build
In all situations I've tried
forbid
instead ofdeny
, and movingbuild
beforeconfig
.Possible Solution(s)
No response
Notes
ci.toml
toCargo.toml
and building withcargo build
produces the expected result:cargo --config build.target-dir=\"somewhere-else\" build
which changes the target dir & works as expected.Version
The text was updated successfully, but these errors were encountered: