-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(F811): assignment can also be shadowed binding
- Loading branch information
Showing
5 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
crates/ruff_linter/resources/test/fixtures/pyflakes/F811_30.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
"""Regression test for: https://github.com/astral-sh/ruff/issues/11828""" | ||
|
||
|
||
class A: | ||
"""A.""" | ||
|
||
def foo(self) -> None: | ||
"""Foo.""" | ||
|
||
bar = foo | ||
|
||
def bar(self) -> None: | ||
"""Bar.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...er/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_30.py.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/pyflakes/mod.rs | ||
--- | ||
F811_30.py:12:9: F811 Redefinition of unused `bar` from line 10 | ||
| | ||
10 | bar = foo | ||
11 | | ||
12 | def bar(self) -> None: | ||
| ^^^ F811 | ||
13 | """Bar.""" | ||
| | ||
= help: Remove definition: `bar` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters