forked from pylint-dev/pylint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
… loop variables in body
- Loading branch information
1 parent
3366e0d
commit a80ad9f
Showing
17 changed files
with
64 additions
and
23 deletions.
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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
function-redefined:18:4:18:15:AAAA.method2:method already defined line 15:UNDEFINED | ||
function-redefined:21:0:21:10:AAAA:class already defined line 8:UNDEFINED | ||
function-redefined:35:0:35:9:func2:function already defined line 32:UNDEFINED | ||
redefined-outer-name:37:4:37:16:func2:Redefining name '__revision__' from outer scope (line 7):UNDEFINED | ||
redefined-outer-name:37:4:37:16:func2:Redefining name '__revision__' from outer scope or loop (line 7):UNDEFINED | ||
function-redefined:54:4:54:23:exclusive_func2:function already defined line 48:UNDEFINED | ||
function-redefined:89:0:89:8:ceil:function already defined line 88:UNDEFINED | ||
function-redefined:93:0:93:8:math:function already defined line 92:UNDEFINED |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
invalid-name:7:0:7:5::"Constant name ""value"" doesn't conform to UPPER_CASE naming style":HIGH | ||
redefined-outer-name:12:4:12:9:clobbering:Redefining name 'value' from outer scope (line 7):UNDEFINED | ||
redefined-outer-name:12:4:12:9:clobbering:Redefining name 'value' from outer scope or loop (line 7):UNDEFINED |
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 |
---|---|---|
@@ -1 +1 @@ | ||
redefined-outer-name:4:4:6:20::Redefining name 'item' from outer scope (line 2):UNDEFINED | ||
redefined-outer-name:4:4:6:20::Redefining name 'item' from outer scope or loop (line 2):UNDEFINED |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
redefined-outer-name:11:4:12:12::Redefining name 'err' from outer scope (line 8):UNDEFINED | ||
redefined-outer-name:57:8:58:16::Redefining name 'err' from outer scope (line 51):UNDEFINED | ||
redefined-outer-name:11:4:12:12::Redefining name 'err' from outer scope or loop (line 8):UNDEFINED | ||
redefined-outer-name:57:8:58:16::Redefining name 'err' from outer scope or loop (line 51):UNDEFINED | ||
used-before-assignment:69:14:69:29:func:Using variable 'CustomException' before assignment:HIGH | ||
redefined-outer-name:71:4:72:12:func:Redefining name 'CustomException' from outer scope (line 62):UNDEFINED | ||
redefined-outer-name:71:4:72:12:func:Redefining name 'CustomException' from outer scope or loop (line 62):UNDEFINED |
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,15 @@ | ||
"""Tests for redefinitions of loop variables inside the loop body. | ||
See: https://github.com/PyCQA/pylint/issues/5608 | ||
""" | ||
# pylint: disable=invalid-name | ||
|
||
lines = ["1\t", "2\t"] | ||
for line in lines: | ||
line = line.strip() # [redefined-outer-name] | ||
|
||
lines = [(1, "1\t"), (2, "2\t")] | ||
for i, line in lines: | ||
line = line.strip() # [redefined-outer-name] | ||
|
||
line = "no warning" |
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,2 @@ | ||
redefined-outer-name:9:4:9:8::Redefining name 'line' from outer scope or loop (line 8):UNDEFINED | ||
redefined-outer-name:13:4:13:8::Redefining name 'line' from outer scope or loop (line 12):UNDEFINED |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
redefined-outer-name:7:4:8:16::Redefining name 'i' from outer scope (line 6):UNDEFINED | ||
redefined-outer-name:12:4:13:25::Redefining name 'i' from outer scope (line 11):UNDEFINED | ||
redefined-outer-name:17:4:18:25::Redefining name 'i' from outer scope (line 16):UNDEFINED | ||
redefined-outer-name:22:4:23:25::Redefining name 'a' from outer scope (line 21):UNDEFINED | ||
redefined-outer-name:7:4:8:16::Redefining name 'i' from outer scope or loop (line 6):UNDEFINED | ||
redefined-outer-name:12:4:13:25::Redefining name 'i' from outer scope or loop (line 11):UNDEFINED | ||
redefined-outer-name:17:4:18:25::Redefining name 'i' from outer scope or loop (line 16):UNDEFINED | ||
redefined-outer-name:22:4:23:25::Redefining name 'a' from outer scope or loop (line 21):UNDEFINED |
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 |
---|---|---|
@@ -1 +1 @@ | ||
redefined-outer-name:4:4:5:16::Redefining name 'j' from outer scope (line 3):UNDEFINED | ||
redefined-outer-name:4:4:5:16::Redefining name 'j' from outer scope or loop (line 3):UNDEFINED |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
used-before-assignment:7:7:7:8:used_before_assignment_1:Using variable 'x' before assignment:HIGH | ||
redefined-outer-name:8:12:8:13:used_before_assignment_1:Redefining name 'x' from outer scope (line 3):UNDEFINED | ||
redefined-outer-name:8:12:8:13:used_before_assignment_1:Redefining name 'x' from outer scope or loop (line 3):UNDEFINED | ||
used-before-assignment:13:7:13:8:used_before_assignment_2:Using variable 'x' before assignment:HIGH | ||
redefined-outer-name:15:4:15:5:used_before_assignment_2:Redefining name 'x' from outer scope (line 3):UNDEFINED | ||
redefined-outer-name:15:4:15:5:used_before_assignment_2:Redefining name 'x' from outer scope or loop (line 3):UNDEFINED | ||
used-before-assignment:19:7:19:8:used_before_assignment_3:Using variable 'x' before assignment:HIGH | ||
redefined-outer-name:21:12:21:13:used_before_assignment_3:Redefining name 'x' from outer scope (line 3):UNDEFINED | ||
redefined-outer-name:30:4:30:5:not_used_before_assignment_2:Redefining name 'x' from outer scope (line 3):UNDEFINED | ||
redefined-outer-name:21:12:21:13:used_before_assignment_3:Redefining name 'x' from outer scope or loop (line 3):UNDEFINED | ||
redefined-outer-name:30:4:30:5:not_used_before_assignment_2:Redefining name 'x' from outer scope or loop (line 3):UNDEFINED |