-
-
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.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
dc2bc6a
commit 03aa4ca
Showing
6 changed files
with
94 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# pylint: disable=missing-docstring,invalid-name,using-constant-test | ||
|
||
a, b, c, d = 'a b c d'.split() | ||
|
||
temp = a # [consider-swap-variables] | ||
a = b | ||
b = temp | ||
|
||
temp = a # only simple swaps are reported | ||
a = b | ||
if True: | ||
b = a | ||
|
||
temp = a # this is no swap | ||
a = b | ||
b = a | ||
|
||
temp = a, b # complex swaps are ignored | ||
a, b = c, d | ||
c, d = temp | ||
|
||
temp = a # [consider-swap-variables] | ||
a = b # longer swap circles are only reported once | ||
b = temp | ||
temp = a |
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 @@ | ||
consider-swap-variables:5::Consider using tuple unpacking for swapping variables | ||
consider-swap-variables:22::Consider using tuple unpacking for swapping variables |