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.
[trailing-comma-tuple] Properly emit when disabled globally and enabl…
…ed locally
- Loading branch information
1 parent
171e40f
commit 2ea3405
Showing
9 changed files
with
77 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -336,6 +336,7 @@ testoptions | |
tmp | ||
tokencheckers | ||
tokeninfo | ||
tokenization | ||
tokenize | ||
tokenizer | ||
toml | ||
|
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,4 @@ | ||
``trailing-comma-tuple`` should now be correctly emitted when it was disabled globally | ||
but enabled via local message control, after removal of an over-optimisation. | ||
|
||
Refs #9608. |
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,24 @@ | ||
"""Check trailing comma tuple optimization.""" | ||
# pylint: disable=missing-docstring | ||
|
||
AAA = 1, | ||
BBB = "aaaa", | ||
CCC="aaa", | ||
FFF=['f'], | ||
|
||
def some_func(first, second): | ||
if first: | ||
return first, | ||
if second: | ||
return (first, second,) | ||
return first, second, | ||
|
||
# pylint: enable=trailing-comma-tuple | ||
AAA = 1, # [trailing-comma-tuple] | ||
BBB = "aaaa", # [trailing-comma-tuple] | ||
# pylint: disable=trailing-comma-tuple | ||
CCC="aaa", | ||
III = some_func(0, | ||
0), | ||
# pylint: enable=trailing-comma-tuple | ||
FFF=['f'], # [trailing-comma-tuple] |
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,5 @@ | ||
[MAIN] | ||
disable=trailing-comma-tuple | ||
|
||
[testoptions] | ||
exclude_from_minimal_messages_config=True |
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 @@ | ||
trailing-comma-tuple:17:0:None:None::Disallow trailing comma tuple:HIGH | ||
trailing-comma-tuple:18:0:None:None::Disallow trailing comma tuple:HIGH | ||
trailing-comma-tuple:24:0:None:None::Disallow trailing comma tuple:HIGH |