-
-
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.
[trailing-comma-tuple] Fix enabling with message control locally when…
… disabled for the file (#9609) (#9649) * [trailing-comma-tuple] Set the confidence to HIGH * [trailing-comma-tuple] Properly emit when disabled globally and enabled locally * [trailing-comma-tuple] Handle case with space between 'enable' and '=' (cherry picked from commit 96fad05) Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
- Loading branch information
1 parent
1498675
commit 926547b
Showing
10 changed files
with
96 additions
and
20 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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
trailing-comma-tuple:3:0:None:None::Disallow trailing comma tuple:UNDEFINED | ||
trailing-comma-tuple:4:0:None:None::Disallow trailing comma tuple:UNDEFINED | ||
trailing-comma-tuple:5:0:None:None::Disallow trailing comma tuple:UNDEFINED | ||
trailing-comma-tuple:6:0:None:None::Disallow trailing comma tuple:UNDEFINED | ||
trailing-comma-tuple:31:0:None:None::Disallow trailing comma tuple:UNDEFINED | ||
trailing-comma-tuple:34:0:None:None::Disallow trailing comma tuple:UNDEFINED | ||
trailing-comma-tuple:38:0:None:None::Disallow trailing comma tuple:UNDEFINED | ||
trailing-comma-tuple:41:0:None:None::Disallow trailing comma tuple:UNDEFINED | ||
trailing-comma-tuple:47:0:None:None::Disallow trailing comma tuple:UNDEFINED | ||
trailing-comma-tuple:3:0:None:None::Disallow trailing comma tuple:HIGH | ||
trailing-comma-tuple:4:0:None:None::Disallow trailing comma tuple:HIGH | ||
trailing-comma-tuple:5:0:None:None::Disallow trailing comma tuple:HIGH | ||
trailing-comma-tuple:6:0:None:None::Disallow trailing comma tuple:HIGH | ||
trailing-comma-tuple:31:0:None:None::Disallow trailing comma tuple:HIGH | ||
trailing-comma-tuple:34:0:None:None::Disallow trailing comma tuple:HIGH | ||
trailing-comma-tuple:38:0:None:None::Disallow trailing comma tuple:HIGH | ||
trailing-comma-tuple:41:0:None:None::Disallow trailing comma tuple:HIGH | ||
trailing-comma-tuple:47:0:None:None::Disallow trailing comma tuple:HIGH | ||
trailing-comma-tuple:54:0:None:None::Disallow trailing comma tuple:HIGH | ||
trailing-comma-tuple:60:0:None:None::Disallow trailing comma tuple:HIGH |
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 |