summaryrefslogtreecommitdiff
path: root/tests/functional/t/trailing_comma_tuple.py
blob: de60184cab3cdce073ab48103249c3bf9e322cd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
"""Check trailing comma one element tuples."""
# pylint: disable=missing-docstring
AAA = 1, # [trailing-comma-tuple]
BBB = "aaaa", # [trailing-comma-tuple]
CCC="aaa", # [trailing-comma-tuple]
FFF=['f'], # [trailing-comma-tuple]

BBB = 1, 2
CCC = (1, 2, 3)
DDD = (
    1, 2, 3,
)
EEE = (
    "aaa",
)


def test(*args, **kwargs):
    return args, kwargs


test(widget=1, label='test')
test(widget=1,
     label='test')
test(widget=1, \
     label='test')


def some_func(first, second):
    if first:
        return first, # [trailing-comma-tuple]
    if second:
        return (first, second,)
    return first, second,  # [trailing-comma-tuple]


def some_other_func():
    yield 'hello',  # [trailing-comma-tuple]

GGG = ["aaa"
], # [trailing-comma-tuple]

HHH = ["aaa"
]

III = some_func(0,
    0), # [trailing-comma-tuple]

JJJ = some_func(0,
    0)