aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/parso/py3/tests/normalizer_issue_files/E12_second.py
blob: 5488ea40ebc0261b2ae123514cdf72b9ecbaadea (plain) (blame)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
if True:
    result = some_function_that_takes_arguments(
        'a', 'b', 'c',
        'd', 'e', 'f',
        #: E123:0
)
#: E122+1
if some_very_very_very_long_variable_name or var \
or another_very_long_variable_name:
    raise Exception()
#: E122+1
if some_very_very_very_long_variable_name or var[0] \
or another_very_long_variable_name:
    raise Exception()
if True:
    #: E122+1
    if some_very_very_very_long_variable_name or var \
    or another_very_long_variable_name:
        raise Exception()
if True:
    #: E122+1
    if some_very_very_very_long_variable_name or var[0] \
    or another_very_long_variable_name:
        raise Exception()

#: E901+1:8
dictionary = [
    "is": {
        # Might be a E122:4, but is not because the code is invalid Python.
    "nested": yes(),
    },
]
setup('',
      scripts=[''],
      classifiers=[
          #: E121:6
      'Development Status :: 4 - Beta',
          'Environment :: Console',
          'Intended Audience :: Developers',
      ])


#: E123+2:4 E291:15
abc = "E123", (   
    "bad", "hanging", "close"
    )

result = {
    'foo': [
        'bar', {
            'baz': 'frop',
            #: E123
            }
        #: E123
        ]
    #: E123
    }
result = some_function_that_takes_arguments(
    'a', 'b', 'c',
    'd', 'e', 'f',
    #: E123
    )
my_list = [1, 2, 3,
           4, 5, 6,
           #: E124:0
]
my_list = [1, 2, 3,
           4, 5, 6,
           #: E124:19
                   ]
#: E124+2
result = some_function_that_takes_arguments('a', 'b', 'c',
                                            'd', 'e', 'f',
)
fooff(aaaa,
      cca(
          vvv,
          dadd
      ), fff,
      #: E124:0
)
fooff(aaaa,
      ccaaa(
          vvv,
          dadd
      ),
      fff,
      #: E124:0
)
d = dict('foo',
         help="exclude files or directories which match these "
              "comma separated patterns (default: %s)" % DEFAULT_EXCLUDE
         #: E124:14
              )

if line_removed:
    self.event(cr, uid,
               #: E128:8
        name="Removing the option for contract",
               #: E128:8
        description="contract line has been removed",
               #: E124:8
        )

#: E129+1:4
if foo is None and bar is "frop" and \
    blah == 'yeah':
    blah = 'yeahnah'


#: E129+1:4 E129+2:4
def long_function_name(
    var_one, var_two, var_three,
    var_four):
    hello(var_one)


def qualify_by_address(
        #: E129:4 E129+1:4
    self, cr, uid, ids, context=None,
    params_to_check=frozenset(QUALIF_BY_ADDRESS_PARAM)):
    """ This gets called by the web server """


#: E129+1:4 E129+2:4
if (a == 2 or
    b == "abc def ghi"
    "jkl mno"):
    True

my_list = [
    1, 2, 3,
    4, 5, 6,
    #: E123:8
        ]

abris = 3 + \
        4 + \
        5 + 6

fixed = re.sub(r'\t+', ' ', target[c::-1], 1)[::-1] + \
        target[c + 1:]

rv.update(dict.fromkeys((
              'qualif_nr', 'reasonComment_en', 'reasonComment_fr',
              #: E121:12
            'reasonComment_de', 'reasonComment_it'),
                        '?'),
          #: E128:4
    "foo")
#: E126+1:8
eat_a_dict_a_day({
        "foo": "bar",
})
#: E129+1:4
if (
    x == (
            3
            #: E129:4
    ) or
        y == 4):
    pass
#: E129+1:4 E121+2:8 E129+3:4
if (
    x == (
        3
    ) or
        x == (
            # This one has correct indentation.
            3
            #: E129:4
    ) or
        y == 4):
    pass
troublesome_hash = {
    "hash": "value",
    #: E135+1:8
    "long": "the quick brown fox jumps over the lazy dog before doing a "
        "somersault",
}

# Arguments on first line forbidden when not using vertical alignment
#: E128+1:4
foo = long_function_name(var_one, var_two,
    var_three, var_four)

#: E128+1:4
hello('l.%s\t%s\t%s\t%r' %
    (token[2][0], pos, tokenize.tok_name[token[0]], token[1]))


def qualify_by_address(self, cr, uid, ids, context=None,
                       #: E128:8
        params_to_check=frozenset(QUALIF_BY_ADDRESS_PARAM)):
    """ This gets called by the web server """