Skip to content

Commit 836111e

Browse files
committed
refactor: Warn not Error on unsupported lint tool
1 parent ba6fb40 commit 836111e

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/cargo/util/toml/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2231,8 +2231,8 @@ fn verify_lints(
22312231
for (tool, lints) in lints {
22322232
let supported = ["cargo", "clippy", "rust", "rustdoc"];
22332233
if !supported.contains(&tool.as_str()) {
2234-
let supported = supported.join(", ");
2235-
anyhow::bail!("unsupported `{tool}` in `[lints]`, must be one of {supported}")
2234+
warnings.push(format!("unused manifest key `lints.{tool}`",));
2235+
continue;
22362236
}
22372237
if tool == "cargo" && !gctx.cli_unstable().cargo_lints {
22382238
warn_for_cargo_lint_feature(gctx, warnings);

tests/testsuite/lints_table.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,11 @@ fn fail_on_invalid_tool() {
105105
.build();
106106

107107
foo.cargo("check")
108-
.with_status(101)
109108
.with_stderr(
110109
"\
111-
[..]
112-
113-
Caused by:
114-
unsupported `super-awesome-linter` in `[lints]`, must be one of cargo, clippy, rust, rustdoc
110+
[WARNING] [CWD]/Cargo.toml: unused manifest key `lints.super-awesome-linter`
111+
[CHECKING] foo v0.0.1 ([CWD])
112+
[FINISHED] [..]
115113
",
116114
)
117115
.run();

0 commit comments

Comments
 (0)