-
-
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.
Added a new check,
redeclared-assigned-name
This check is emitted when ``pylint`` detects that a name was assigned one or multiple times in the same assignment, which indicate a potential bug. Close #2898
- Loading branch information
1 parent
4f943ed
commit f38bd0d
Showing
5 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# pylint: disable=missing-docstring | ||
|
||
FIRST, FIRST = (1, 2) # [redeclared-assigned-name] | ||
|
||
for SECOND, SECOND in enumerate(range(5, 10)): # [redeclared-assigned-name] | ||
print(SECOND) | ||
|
||
for FIRST, (SECOND, FIRST, SECOND) in enumerate(range(5, 10)): # [redeclared-assigned-name] | ||
print(SECOND) |
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,3 @@ | ||
redeclared-assigned-name:3::Redeclared variable 'FIRST' in assignment | ||
redeclared-assigned-name:5::Redeclared variable 'SECOND' in assignment | ||
redeclared-assigned-name:8::Redeclared variable 'SECOND' in assignment |