... /opt/.cargo/registry/src/github.com-1ecc6299db9ec823/im-12.3.1/clippy.toml: found deprecated field cyclomatic-complexity-threshold. Please use cognitive-complexity-threshold instead.
I use clippy in CI, and started getting this error a few days ago. The error is coming from one of my dependencies, so I don't expect clippy to be checking it to begin with.
Is there a way to stop clippy from checking dependencies / make the error a warning instead?
Yeah errors of clippy.toml files of dependencies should not be reported at all.
I just checked. Our code for detecting the final binary doesn't seem to work anymore. All dependencies are run through clippy-driver, not sure when that changed. What we can do in the short term is to change the error to a normal lint so it will get silenced by --cap-lints.
We should make all the span_err or struct_err calls in https://github.com/rust-lang/rust-clippy/blob/1cdac4a9c798f8e22a4db220020713175eb9159b/clippy_lints/src/lib.rs#L311 forward to buffer_lint (https://doc.rust-lang.org/nightly/nightly-rustc/rustc/session/struct.Session.html#method.buffer_lint).
The driver stuff got completely rewritten recently since rustc changed how drivers work.
I ran into this as well, with a dependency having a clippy.toml file with a deprecated field (cyclomatic-complexity-threshold).
I just ran into this as well because of using a very old pinned version of clippy on one project. Quick repro with an invalid config file, might be a different error path to having invalid keys in there:
> cd $(mktemp -d)
> cargo new --lib foo
Created library `foo` package
> cd foo
> cargo add --git https://gist.github.com/Nemo157/963cf5ae958aabb40dbf35dea7b8a9e2 bar
Adding bar (unknown version) to dependencies
> cargo +stable clippy --all-targets
Updating git repository `https://gist.github.com/Nemo157/963cf5ae958aabb40dbf35dea7b8a9e2`
Checking bar v0.1.0 (https://gist.github.com/Nemo157/963cf5ae958aabb40dbf35dea7b8a9e2#b81c54a5)
error: error reading Clippy's configuration file `/home/wim/.cargo/git/checkouts/963cf5ae958aabb40dbf35dea7b8a9e2-9bdfc6a77ca53f42/b81c54a/clippy.toml`: expected an equals, found an identifier at line 1
I have also ran into this unfortunate bug due to using an unmaintained project as a dependency.
I can take this under the assumption that it's still a good-first-issue (presumably if nobody has fixed it, it either isn't as easy as it looks, or is very rare)
Most helpful comment
I ran into this as well, with a dependency having a
clippy.tomlfile with a deprecated field (cyclomatic-complexity-threshold).