rust/clippy_lints
bors 48dad265ab Auto merge of #7214 - xFrednet:7197-collecting-configuration, r=flip1995,camsteffen
Metadata collection monster searching for Clippy's configuration options

This PR teaches our lovely metadata collection monster which configurations are available inside Clippy. It then adds a new *Configuration* section to the lint documentation.

---

The implementation uses the `define_Conf!` macro to create a vector of metadata during compilation. This enables easy collection and parsing without the need of searching for the struct during a lint-pass (and it's quite elegant IMO). The information is then parsed into an intermediate struct called `ClippyConfiguration` which will be saved inside the `MetadataCollector` struct itself. It is currently only used to generate the *Configuration* section in the lint documentation, but I'm thinking about adding an overview of available configurations to the website. Saving them in this intermediate state without formatting them right away enables this in the future.

The new parsing will also allow us to have a documentation that spans over multiple lines in the future. For example, this will be valid when the old script has been removed:
```rust
/// Lint: BLACKLISTED_NAME.
/// The list of blacklisted names to lint about. NB: `bar` is not here since it has legitimate uses
(blacklisted_names: Vec<String> = ["foo", "baz", "quux"].iter().map(ToString::to_string).collect())
```

The deprecation reason is also currently being collected but not used any further and that's basically it.

---

See: #7172 for the full metadata collection to-do list or to suggest a new feature in connection to it 🙃

---

changelog: none

r? `@flip1995`
cc `@camsteffen` It would be great if you could also review this PR as you have recently worked on Clippy's `define_Conf!` macro.
2021-05-16 21:02:02 +00:00
..
src Auto merge of #7214 - xFrednet:7197-collecting-configuration, r=flip1995,camsteffen 2021-05-16 21:02:02 +00:00
Cargo.toml Bump Clippy version -> 0.1.54 2021-05-06 11:32:34 +02:00
README.md

This crate contains Clippy lints. For the main crate, check GitHub.