Skip to content

Polish missing_enforced_import_renames documentation #12036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions clippy_lints/src/missing_enforced_import_rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down