Skip to content

Commit 4adfca6

Browse files
yunchipangGlyphack
authored andcommitted
[pylint] add fix safety section (PLC0414) (astral-sh#17802)
This PR adds a fix safety section in comment for rule `PLC0414`. parent: astral-sh#15584 discussion: astral-sh#6294
1 parent b3b77c6 commit 4adfca6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

crates/ruff_linter/src/rules/pylint/rules/useless_import_alias.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ use crate::checkers::ast::Checker;
1212
/// ## Why is this bad?
1313
/// The import alias is redundant and should be removed to avoid confusion.
1414
///
15+
/// ## Fix safety
16+
/// This fix is marked as always unsafe because the user may be intentionally
17+
/// re-exporting the import. While statements like `import numpy as numpy`
18+
/// appear redundant, they can have semantic meaning in certain contexts.
19+
///
1520
/// ## Example
1621
/// ```python
1722
/// import numpy as numpy

0 commit comments

Comments
 (0)