-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
C-bugCategory: bugCategory: bugS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.
Description
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- Put the following in
src/main.rs:fn main() { let vârïàblê = "non-ascii"; println!("Hello, {}!", vârïàblê); }
- Put the following in
ci.toml:[lints.rust] non_ascii_idents="deny"
- Try and build with
cargo --config "lints.rust.non_ascii_idents = \"deny\"" buildcargo --config lints.rust.non_ascii_idents=\"deny\" buildcargo --config "lints.rust.non_ascii_idents='deny'" buildcargo --config 'lints.rust.non_ascii_idents="deny"' buildcargo --config ci.toml build
In all situations I've triedforbidinstead ofdeny, and movingbuildbeforeconfig.
- Notice that in none of the builds we get a failure, even though we expect it to.
Possible Solution(s)
No response
Notes
- Moving the lint from
ci.tomltoCargo.tomland building withcargo buildproduces the expected result:kristof@NOSTROMO:~/lint-config$ cargo build Compiling lint-config v0.1.0 (/home/kristof/lint-config) error: identifier contains non-ASCII characters --> src/main.rs:2:9 | 2 | let vârïàblê = "non-ascii"; | ^^^^^^^^ | = note: requested on the command line with `-D non-ascii-idents` error: could not compile `lint-config` (bin "lint-config") due to previous error
- Making sure this is supported I tried with
cargo --config build.target-dir=\"somewhere-else\" buildwhich changes the target dir & works as expected.
Version
cargo 1.74.0 (ecb9851af 2023-10-18)
release: 1.74.0
commit-hash: ecb9851afd3095e988daaa35a48bc7f3cb748e04
commit-date: 2023-10-18
host: x86_64-unknown-linux-gnu
libgit2: 1.7.1 (sys:0.18.0 vendored)
libcurl: 8.4.0-DEV (sys:0.4.68+curl-8.4.0 vendored ssl:OpenSSL/1.1.1u)
ssl: OpenSSL 1.1.1u 30 May 2023
os: Ubuntu 23.10 (mantic) [64-bit]
Metadata
Metadata
Assignees
Labels
C-bugCategory: bugCategory: bugS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.