mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 12:29:28 +00:00
[pylint
] (Re-)Implement import-private-name
(C2701
) (#9553)
## Summary #5920 with a fix for the erroneous slice in `module_name`. Fixes #9547. ## Test Plan Added `import bbb.ccc._ddd as eee` to the test fixture to ensure it no longer panics. `cargo test`
This commit is contained in:
parent
3aae16f1bd
commit
f426c0fdaf
16 changed files with 326 additions and 0 deletions
|
@ -217,6 +217,7 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
|
|||
(Pylint, "C2801") => (RuleGroup::Preview, rules::pylint::rules::UnnecessaryDunderCall),
|
||||
#[allow(deprecated)]
|
||||
(Pylint, "C1901") => (RuleGroup::Nursery, rules::pylint::rules::CompareToEmptyString),
|
||||
(Pylint, "C2701") => (RuleGroup::Preview, rules::pylint::rules::ImportPrivateName),
|
||||
(Pylint, "C3002") => (RuleGroup::Stable, rules::pylint::rules::UnnecessaryDirectLambdaCall),
|
||||
(Pylint, "E0100") => (RuleGroup::Stable, rules::pylint::rules::YieldInInit),
|
||||
(Pylint, "E0101") => (RuleGroup::Stable, rules::pylint::rules::ReturnInInit),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue