1407c7627e
Add configuration options to `--explain` This PR rearranges some modules, taking `metadata_collector` out of `internal_lints` and making public just the necessary functions for `explain()` to use. The output looks something like this: ```sh $ cargo run --bin cargo-clippy --manifest-path ../rust-clippy/Cargo.toml -- --explain cognitive_complexity ### What it does Checks for methods with high cognitive complexity. ### Why is this bad? Methods of high cognitive complexity tend to be hard to both read and maintain. Also LLVM will tend to optimize small methods better. ### Known problems Sometimes it's hard to find a way to reduce the complexity. ### Example You'll see it when you get the warning. ======================================== Configuration for clippy::cognitive_complexity: - cognitive-complexity-threshold: The maximum cognitive complexity a function can have (default: 25) ``` Fixes #9990 r? `@xFrednet` --- changelog: Docs: `cargo clippy --explain LINT` now shows possible configuration options for the explained lint [#10751](https://github.com/rust-lang/rust-clippy/pull/10751) <!-- changelog_checked -->