-
-
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' check was added
This message is emitted when pylint finds an one-element tuple, created by a stray comma. This can suggest a potential problem in the code and it is recommended to use parantheses in order to emphasise the creation of a tuple, rather than relying on the comma itself. Close #300
- Loading branch information
1 parent
7aee3e3
commit 6ae2b77
Showing
6 changed files
with
78 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"""Check trailing comma one element tuples.""" | ||
# pylint: disable=bad-whitespace | ||
AAA = 1, # [trailing-comma-tuple] | ||
BBB = "aaaa", # [trailing-comma-tuple] | ||
CCC="aaa", # [trailing-comma-tuple] | ||
|
||
BBB = 1, 2 | ||
CCC = (1, 2, 3) | ||
DDD = ( | ||
1, 2, 3, | ||
) | ||
EEE = ( | ||
"aaa", | ||
) |
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 @@ | ||
[testoptions] | ||
min_pyver=3.0 |
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:3::Disallow trailing comma tuple | ||
trailing-comma-tuple:4::Disallow trailing comma tuple | ||
trailing-comma-tuple:5::Disallow trailing comma tuple |