about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-05 15:31:27 +0000
committerbors <bors@rust-lang.org>2024-01-05 15:31:27 +0000
commiteec0f3d6aa8b12b4c25b5fcc05b25a925ef4da1e (patch)
tree6ddde81b07c2c64f52144b507bf3cc7e27b42275
parentd3dfecbd418e8518f20f3a0660fdc204b07736c1 (diff)
parentb8aab4bd1dbb842ca79e9c6c1db663935a0b044e (diff)
Auto merge of #12036 - kpreid:patch-1, r=Alexendoo
Polish `missing_enforced_import_renames` documentation

* Fixes a typo in the name of the lint (`enforce-import-renames` instead of `enforced-import-renames`).
* Copyedit “Why” paragraph.
* Make the example configuration use a multi-line list, since it is not particularly expected that a real project will have *exactly one* rename to enforce (and the old formatting had unbalanced whitespace).

changelog: none
-rw-r--r--clippy_lints/src/missing_enforced_import_rename.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/clippy_lints/src/missing_enforced_import_rename.rs b/clippy_lints/src/missing_enforced_import_rename.rs
index c1f6c71a63e..c6c188854fd 100644
--- a/clippy_lints/src/missing_enforced_import_rename.rs
+++ b/clippy_lints/src/missing_enforced_import_rename.rs
@@ -13,21 +13,23 @@ use rustc_span::Symbol;
 declare_clippy_lint! {
     /// ### What it does
     /// Checks for imports that do not rename the item as specified
-    /// in the `enforce-import-renames` config option.
+    /// in the `enforced-import-renames` config option.
     ///
     /// Note: Even though this lint is warn-by-default, it will only trigger if
-    /// import renames are defined in the clippy.toml file.
+    /// import renames are defined in the `clippy.toml` file.
     ///
     /// ### Why is this bad?
-    /// Consistency is important, if a project has defined import
-    /// renames they should be followed. More practically, some item names are too
-    /// vague outside of their defining scope this can enforce a more meaningful naming.
+    /// Consistency is important; if a project has defined import renames, then they should be
+    /// followed. More practically, some item names are too vague outside of their defining scope,
+    /// in which case this can enforce a more meaningful naming.
     ///
     /// ### Example
     /// An example clippy.toml configuration:
     /// ```toml
     /// # clippy.toml
-    /// enforced-import-renames = [ { path = "serde_json::Value", rename = "JsonValue" }]
+    /// enforced-import-renames = [
+    ///     { path = "serde_json::Value", rename = "JsonValue" },
+    /// ]
     /// ```
     ///
     /// ```rust,ignore