Small documentation update for the new metadata_collector
This commit is contained in:
parent
c50e6e4203
commit
c01aa64591
@ -31,9 +31,6 @@ impl TryConf {
|
||||
}
|
||||
}
|
||||
|
||||
/// Note that the configuration parsing currently doesn't support documentation that will
|
||||
/// that spans over several lines. This will be possible with the new implementation
|
||||
/// See (rust-clippy#7172)
|
||||
macro_rules! define_Conf {
|
||||
($(
|
||||
$(#[doc = $doc:literal])+
|
||||
@ -130,7 +127,6 @@ macro_rules! define_Conf {
|
||||
};
|
||||
}
|
||||
|
||||
// N.B., this macro is parsed by util/lintlib.py
|
||||
define_Conf! {
|
||||
/// 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.
|
||||
///
|
||||
|
@ -82,7 +82,7 @@ This lint has the following configuration variables:
|
||||
/// `default`
|
||||
macro_rules! CONFIGURATION_VALUE_TEMPLATE {
|
||||
() => {
|
||||
"* {name}: `{ty}`: {doc} (defaults to `{default}`)\n"
|
||||
"* `{name}`: `{ty}`: {doc} (defaults to `{default}`)\n"
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -559,11 +559,12 @@ in the following steps:
|
||||
1. Adding a new configuration entry to [clippy_utils::conf](/clippy_utils/src/conf.rs)
|
||||
like this:
|
||||
```rust
|
||||
/// Lint: LINT_NAME. <The configuration field doc comment>
|
||||
/// Lint: LINT_NAME.
|
||||
///
|
||||
/// <The configuration field doc comment>
|
||||
(configuration_ident: Type = DefaultValue),
|
||||
```
|
||||
The configuration value and identifier should usually be the same. The doc comment will be
|
||||
automatically added to the lint documentation.
|
||||
The doc comment will be automatically added to the lint documentation.
|
||||
2. Adding the configuration value to the lint impl struct:
|
||||
1. This first requires the definition of a lint impl struct. Lint impl structs are usually
|
||||
generated with the `declare_lint_pass!` macro. This struct needs to be defined manually
|
||||
|
Loading…
x
Reference in New Issue
Block a user