]> git.madduck.net Git - etc/vim.git/blob - tests/data/function_trailing_comma.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Consistency: use variable names that correspond to the methods they invoke
[etc/vim.git] / tests / data / function_trailing_comma.py
1 def f(a,):
2     d = {'key': 'value',}
3     tup = (1,)
4
5 def f2(a,b,):
6     d = {'key': 'value', 'key2': 'value2',}
7     tup = (1,2,)
8
9 def f(a:int=1,):
10     call(arg={'explode': 'this',})
11     call2(arg=[1,2,3],)
12     x = {
13         "a": 1,
14         "b": 2,
15     }["a"]
16     if a == {"a": 1,"b": 2,"c": 3,"d": 4,"e": 5,"f": 6,"g": 7,"h": 8,}["a"]:
17         pass
18
19 def xxxxxxxxxxxxxxxxxxxxxxxxxxxx() -> Set[
20     "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
21 ]:
22     json = {"k": {"k2": {"k3": [1,]}}}
23
24 # output
25
26 def f(
27     a,
28 ):
29     d = {
30         "key": "value",
31     }
32     tup = (1,)
33
34
35 def f2(
36     a,
37     b,
38 ):
39     d = {
40         "key": "value",
41         "key2": "value2",
42     }
43     tup = (
44         1,
45         2,
46     )
47
48
49 def f(
50     a: int = 1,
51 ):
52     call(
53         arg={
54             "explode": "this",
55         }
56     )
57     call2(
58         arg=[1, 2, 3],
59     )
60     x = {
61         "a": 1,
62         "b": 2,
63     }["a"]
64     if a == {
65         "a": 1,
66         "b": 2,
67         "c": 3,
68         "d": 4,
69         "e": 5,
70         "f": 6,
71         "g": 7,
72         "h": 8,
73     }["a"]:
74         pass
75
76
77 def xxxxxxxxxxxxxxxxxxxxxxxxxxxx() -> Set[
78     "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
79 ]:
80     json = {
81         "k": {
82             "k2": {
83                 "k3": [
84                     1,
85                 ]
86             }
87         }
88     }