diff options
| author | bors <bors@rust-lang.org> | 2024-01-20 22:58:23 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-01-20 22:58:23 +0000 |
| commit | fe3e6827c30a35caa9575ffe9dd38265fae475d5 (patch) | |
| tree | c721d74f191cd0a4b9b361f523dac306fb763577 | |
| parent | 70573af31eb9b8431c2e7923325c82ba0304cbb2 (diff) | |
| parent | 44f5d969d5820cdf907817f0ce2d81cc54589f77 (diff) | |
| download | rust-fe3e6827c30a35caa9575ffe9dd38265fae475d5.tar.gz rust-fe3e6827c30a35caa9575ffe9dd38265fae475d5.zip | |
Auto merge of #12144 - blyxyas:10283-postfix, r=llogiq
Add . to end of lint lists in configuration + Fix typo in pub_underscore_fields_behavior Fixes https://github.com/rust-lang/rust-clippy/pull/10283#issuecomment-1890600381 In the "/// Lint: " list on each configuration option, you have to end with a dot. If the lint list doesn't have a dot, the configuration won't have documentation. This PR adds those missing dots in some of the configuration, thus also adding their documentation. changelog: Fix bug where a lot of config documentation wasn't showing. changelog: Fix typo in `pub_underscore_fields_behavior` (`PublicallyExported` -> `PubliclyExported`)
| -rw-r--r-- | book/src/lint_configuration.md | 9 | ||||
| -rw-r--r-- | clippy_config/src/conf.rs | 8 | ||||
| -rw-r--r-- | clippy_config/src/types.rs | 2 | ||||
| -rw-r--r-- | clippy_lints/src/pub_underscore_fields.rs | 2 | ||||
| -rw-r--r-- | tests/ui-toml/pub_underscore_fields/exported/clippy.toml | 2 |
5 files changed, 13 insertions, 10 deletions
diff --git a/book/src/lint_configuration.md b/book/src/lint_configuration.md index 16e343401c4..32c19d851fe 100644 --- a/book/src/lint_configuration.md +++ b/book/src/lint_configuration.md @@ -769,6 +769,8 @@ Additional dotfiles (files or directories starting with a dot) to allow ## `enforce-iter-loop-reborrow` +Whether to recommend using implicit into iter for reborrowed values. + #### Example ```no_run let mut vec = vec![1, 2, 3]; @@ -793,7 +795,7 @@ for _ in &mut *rmvec {} ## `check-private-items` - +Whether to also run the listed lints on private items. **Default Value:** `false` @@ -806,9 +808,10 @@ for _ in &mut *rmvec {} ## `pub-underscore-fields-behavior` +Lint "public" fields in a struct that are prefixed with an underscore based on their +exported visibility, or whether they are marked as "pub". - -**Default Value:** `"PublicallyExported"` +**Default Value:** `"PubliclyExported"` --- **Affected lints:** diff --git a/clippy_config/src/conf.rs b/clippy_config/src/conf.rs index 76e25a814b2..3ba7c564796 100644 --- a/clippy_config/src/conf.rs +++ b/clippy_config/src/conf.rs @@ -523,7 +523,7 @@ define_Conf! { /// /// Additional dotfiles (files or directories starting with a dot) to allow (allowed_dotfiles: FxHashSet<String> = FxHashSet::default()), - /// Lint: EXPLICIT_ITER_LOOP + /// Lint: EXPLICIT_ITER_LOOP. /// /// Whether to recommend using implicit into iter for reborrowed values. /// @@ -543,15 +543,15 @@ define_Conf! { /// for _ in &mut *rmvec {} /// ``` (enforce_iter_loop_reborrow: bool = false), - /// Lint: MISSING_SAFETY_DOC, UNNECESSARY_SAFETY_DOC, MISSING_PANICS_DOC, MISSING_ERRORS_DOC + /// Lint: MISSING_SAFETY_DOC, UNNECESSARY_SAFETY_DOC, MISSING_PANICS_DOC, MISSING_ERRORS_DOC. /// /// Whether to also run the listed lints on private items. (check_private_items: bool = false), - /// Lint: PUB_UNDERSCORE_FIELDS + /// Lint: PUB_UNDERSCORE_FIELDS. /// /// Lint "public" fields in a struct that are prefixed with an underscore based on their /// exported visibility, or whether they are marked as "pub". - (pub_underscore_fields_behavior: PubUnderscoreFieldsBehaviour = PubUnderscoreFieldsBehaviour::PublicallyExported), + (pub_underscore_fields_behavior: PubUnderscoreFieldsBehaviour = PubUnderscoreFieldsBehaviour::PubliclyExported), } /// Search for the configuration file. diff --git a/clippy_config/src/types.rs b/clippy_config/src/types.rs index baee09629ac..435aa9244c5 100644 --- a/clippy_config/src/types.rs +++ b/clippy_config/src/types.rs @@ -129,6 +129,6 @@ unimplemented_serialize! { #[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize)] pub enum PubUnderscoreFieldsBehaviour { - PublicallyExported, + PubliclyExported, AllPubFields, } diff --git a/clippy_lints/src/pub_underscore_fields.rs b/clippy_lints/src/pub_underscore_fields.rs index 00465ce4381..88b5a6cfe2a 100644 --- a/clippy_lints/src/pub_underscore_fields.rs +++ b/clippy_lints/src/pub_underscore_fields.rs @@ -54,7 +54,7 @@ impl<'tcx> LateLintPass<'tcx> for PubUnderscoreFields { }; let is_visible = |field: &FieldDef<'_>| match self.behavior { - PubUnderscoreFieldsBehaviour::PublicallyExported => cx.effective_visibilities.is_reachable(field.def_id), + PubUnderscoreFieldsBehaviour::PubliclyExported => cx.effective_visibilities.is_reachable(field.def_id), PubUnderscoreFieldsBehaviour::AllPubFields => { // If there is a visibility span then the field is marked pub in some way. !field.vis_span.is_empty() diff --git a/tests/ui-toml/pub_underscore_fields/exported/clippy.toml b/tests/ui-toml/pub_underscore_fields/exported/clippy.toml index 94a0d3554bc..2b79cbd46e4 100644 --- a/tests/ui-toml/pub_underscore_fields/exported/clippy.toml +++ b/tests/ui-toml/pub_underscore_fields/exported/clippy.toml @@ -1 +1 @@ -pub-underscore-fields-behavior = "PublicallyExported" \ No newline at end of file +pub-underscore-fields-behavior = "PubliclyExported" \ No newline at end of file |
