Skip to content

Commit cde7e6b

Browse files
committed
Auto merge of rust-lang#7578 - xFrednet:7172-update-some-docs, r=camsteffen
Small documentation update for the new metadata_collector Just small documentation updates after the merge of the new metadata collection. I'm also here to deliver on the promised fairy tale: *Once upon a time, there was a world with many languages. One of the oldest was C a very versatile language that gave great power for the cost of great complexity and manual work. C was so powerful that it was able to create new languages. There is Java a versatile language often used by companies and in formal settings. Python that focused on readability and rapid prototyping capabilities. JavaScript which has some interesting edge cases but was still loved and widely used in the world. Together they build the foundation of our world and continue to shape the interactions between kingdoms worldwide.* *C ruled as the king of Linux and other operating systems alongside the Queen C++. Together they were powerful leaders, in fact so powerful that they have been ruling this world for over 49 years. They remain happy together and loved by the community. However, with great power comes great responsibility! The two of them have a dark secret. To tell the truth, they sometimes suffer from memory loss and even worse in some instances from race conditions.* *A mystical creature called Firefox lead to the creation of Mozilla, a global organization fighting for privacy and for their market share in the browser marked. As part of this fight, they started to modify parts of Firefox and eventually created Servo. A completely new creature with a new language called Rust. This new form of communication was focussed on correctness, speed and a new model of memory management.* *Rust grew up over several years with modification to syntax, content among other things. Finally, in 2015 Rust has reached adulthood which enabled it to take part in the global discourse and shape the future of our world. Some even say that this was the start of a new area withing language design.* *Rust had already started to build its kingdom and was now the head of a complete organization, with teams being in charge of individual tools used for further development. One team focussing on further improving Rust when it comes to complexity, style and performance was **The Clippy Team**. Its members were a friendly bunch, with mages and wizards among them.* *With the goal of giving more power to Rust, they identified a Python tool inside Clippy that could be rewritten. This led to the creating of the **Metadata collection monster**. This monster soon replaced the old Python tool and allowed for new creative additions inside Clippy's lint list. With the eradication of the old tool, there came a possibility to update the configuration documentation to span over a lager area. This was done, but some doc comments remained until now in memory of the old tool. This is now the PR that removes these doc comments.* --- I have to stop now, this already took way longer than the actual changes. It probably also contains some spelling mistakes, but oh well. I hope you get the gist of it 🙃. --- r? `@camsteffen` changelog: none
2 parents c50e6e4 + c01aa64 commit cde7e6b

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

clippy_lints/src/utils/conf.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ impl TryConf {
3131
}
3232
}
3333

34-
/// Note that the configuration parsing currently doesn't support documentation that will
35-
/// that spans over several lines. This will be possible with the new implementation
36-
/// See (rust-clippy#7172)
3734
macro_rules! define_Conf {
3835
($(
3936
$(#[doc = $doc:literal])+
@@ -130,7 +127,6 @@ macro_rules! define_Conf {
130127
};
131128
}
132129

133-
// N.B., this macro is parsed by util/lintlib.py
134130
define_Conf! {
135131
/// Lint: ENUM_VARIANT_NAMES, LARGE_TYPES_PASSED_BY_VALUE, TRIVIALLY_COPY_PASS_BY_REF, UNNECESSARY_WRAPS, UPPER_CASE_ACRONYMS, WRONG_SELF_CONVENTION, BOX_VEC, REDUNDANT_ALLOCATION, RC_BUFFER, VEC_BOX, OPTION_OPTION, LINKEDLIST, RC_MUTEX.
136132
///

clippy_lints/src/utils/internal_lints/metadata_collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ This lint has the following configuration variables:
8282
/// `default`
8383
macro_rules! CONFIGURATION_VALUE_TEMPLATE {
8484
() => {
85-
"* {name}: `{ty}`: {doc} (defaults to `{default}`)\n"
85+
"* `{name}`: `{ty}`: {doc} (defaults to `{default}`)\n"
8686
};
8787
}
8888

doc/adding_lints.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,11 +559,12 @@ in the following steps:
559559
1. Adding a new configuration entry to [clippy_utils::conf](/clippy_utils/src/conf.rs)
560560
like this:
561561
```rust
562-
/// Lint: LINT_NAME. <The configuration field doc comment>
562+
/// Lint: LINT_NAME.
563+
///
564+
/// <The configuration field doc comment>
563565
(configuration_ident: Type = DefaultValue),
564566
```
565-
The configuration value and identifier should usually be the same. The doc comment will be
566-
automatically added to the lint documentation.
567+
The doc comment will be automatically added to the lint documentation.
567568
2. Adding the configuration value to the lint impl struct:
568569
1. This first requires the definition of a lint impl struct. Lint impl structs are usually
569570
generated with the `declare_lint_pass!` macro. This struct needs to be defined manually

0 commit comments

Comments
 (0)