Skip to content

Commit

Permalink
refactor: Warn not Error on unsupported lint tool
Browse files Browse the repository at this point in the history
  • Loading branch information
Muscraft committed Apr 30, 2024
1 parent ba6fb40 commit 836111e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/cargo/util/toml/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2231,8 +2231,8 @@ fn verify_lints(
for (tool, lints) in lints {
let supported = ["cargo", "clippy", "rust", "rustdoc"];
if !supported.contains(&tool.as_str()) {
let supported = supported.join(", ");
anyhow::bail!("unsupported `{tool}` in `[lints]`, must be one of {supported}")
warnings.push(format!("unused manifest key `lints.{tool}`",));
continue;
}
if tool == "cargo" && !gctx.cli_unstable().cargo_lints {
warn_for_cargo_lint_feature(gctx, warnings);
Expand Down
8 changes: 3 additions & 5 deletions tests/testsuite/lints_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,11 @@ fn fail_on_invalid_tool() {
.build();

foo.cargo("check")
.with_status(101)
.with_stderr(
"\
[..]
Caused by:
unsupported `super-awesome-linter` in `[lints]`, must be one of cargo, clippy, rust, rustdoc
[WARNING] [CWD]/Cargo.toml: unused manifest key `lints.super-awesome-linter`
[CHECKING] foo v0.0.1 ([CWD])
[FINISHED] [..]
",
)
.run();
Expand Down

0 comments on commit 836111e

Please sign in to comment.