mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 21:35:58 +00:00
[pylint
] Implement nonlocal-and-global
(E115
) (#10407)
## Summary Implement `E115` in the issue #970. Reference to pylint docs: https://pylint.readthedocs.io/en/stable/user_guide/messages/error/nonlocal-and-global.html Throws an error when a variable name is both declared as global and nonlocal ## Test Plan With `nonlocal_and_global.py`
This commit is contained in:
parent
6123a5b8bc
commit
fd26b29986
8 changed files with 183 additions and 1 deletions
|
@ -234,6 +234,7 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
|
|||
(Pylint, "C3002") => (RuleGroup::Stable, rules::pylint::rules::UnnecessaryDirectLambdaCall),
|
||||
(Pylint, "E0100") => (RuleGroup::Stable, rules::pylint::rules::YieldInInit),
|
||||
(Pylint, "E0101") => (RuleGroup::Stable, rules::pylint::rules::ReturnInInit),
|
||||
(Pylint, "E0115") => (RuleGroup::Preview, rules::pylint::rules::NonlocalAndGlobal),
|
||||
(Pylint, "E0116") => (RuleGroup::Stable, rules::pylint::rules::ContinueInFinally),
|
||||
(Pylint, "E0117") => (RuleGroup::Stable, rules::pylint::rules::NonlocalWithoutBinding),
|
||||
(Pylint, "E0118") => (RuleGroup::Stable, rules::pylint::rules::LoadBeforeGlobalDeclaration),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue