pep8: Move to third_party/.
[samba.git] / third_party / pep8 / testsuite / E12.py
1 #: E121
2 print "E121", (
3   "dent")
4 #: E122
5 print "E122", (
6 "dent")
7 #: E123
8 my_list = [
9     1, 2, 3,
10     4, 5, 6,
11     ]
12 #: E124
13 print "E124", ("visual",
14                "indent_two"
15               )
16 #: E124
17 print "E124", ("visual",
18                "indent_five"
19 )
20 #: E124
21 a = (123,
22 )
23 #: E129
24 if (row < 0 or self.moduleCount <= row or
25     col < 0 or self.moduleCount <= col):
26     raise Exception("%s,%s - %s" % (row, col, self.moduleCount))
27 #: E126
28 print "E126", (
29             "dent")
30 #: E126
31 print "E126", (
32         "dent")
33 #: E127
34 print "E127", ("over-",
35                   "over-indent")
36 #: E128
37 print "E128", ("visual",
38     "hanging")
39 #: E128
40 print "E128", ("under-",
41               "under-indent")
42 #:
43
44
45 #: E126
46 my_list = [
47     1, 2, 3,
48     4, 5, 6,
49      ]
50 #: E121
51 result = {
52    'key1': 'value',
53    'key2': 'value',
54 }
55 #: E126 E126
56 rv.update(dict.fromkeys((
57     'qualif_nr', 'reasonComment_en', 'reasonComment_fr',
58     'reasonComment_de', 'reasonComment_it'),
59           '?'),
60           "foo")
61 #: E126
62 abricot = 3 + \
63           4 + \
64           5 + 6
65 #: E131
66 print "hello", (
67
68     "there",
69      # "john",
70     "dude")
71 #: E126
72 part = set_mimetype((
73     a.get('mime_type', 'text')),
74                        'default')
75 #:
76
77
78 #: E122
79 if True:
80     result = some_function_that_takes_arguments(
81         'a', 'b', 'c',
82         'd', 'e', 'f',
83 )
84 #: E122
85 if some_very_very_very_long_variable_name or var \
86 or another_very_long_variable_name:
87     raise Exception()
88 #: E122
89 if some_very_very_very_long_variable_name or var[0] \
90 or another_very_long_variable_name:
91     raise Exception()
92 #: E122
93 if True:
94     if some_very_very_very_long_variable_name or var \
95     or another_very_long_variable_name:
96         raise Exception()
97 #: E122
98 if True:
99     if some_very_very_very_long_variable_name or var[0] \
100     or another_very_long_variable_name:
101         raise Exception()
102 #: E122
103 dictionary = [
104     "is": {
105     "nested": yes(),
106     },
107 ]
108 #: E122
109 setup('',
110       scripts=[''],
111       classifiers=[
112       'Development Status :: 4 - Beta',
113           'Environment :: Console',
114           'Intended Audience :: Developers',
115       ])
116 #:
117
118
119 #: E123 W291
120 print "E123", (
121     "bad", "hanging", "close"
122     )
123 #
124 #: E123 E123 E123
125 result = {
126     'foo': [
127         'bar', {
128             'baz': 'frop',
129             }
130         ]
131     }
132 #: E123
133 result = some_function_that_takes_arguments(
134     'a', 'b', 'c',
135     'd', 'e', 'f',
136     )
137 #: E124
138 my_list = [1, 2, 3,
139            4, 5, 6,
140 ]
141 #: E124
142 my_list = [1, 2, 3,
143            4, 5, 6,
144                    ]
145 #: E124
146 result = some_function_that_takes_arguments('a', 'b', 'c',
147                                             'd', 'e', 'f',
148 )
149 #: E124
150 fooff(aaaa,
151       cca(
152           vvv,
153           dadd
154       ), fff,
155 )
156 #: E124
157 fooff(aaaa,
158       ccaaa(
159           vvv,
160           dadd
161       ),
162       fff,
163 )
164 #: E124
165 d = dict('foo',
166          help="exclude files or directories which match these "
167               "comma separated patterns (default: %s)" % DEFAULT_EXCLUDE
168               )
169 #: E124 E128 E128
170 if line_removed:
171     self.event(cr, uid,
172         name="Removing the option for contract",
173         description="contract line has been removed",
174         )
175 #:
176
177
178 #: E125
179 if foo is None and bar is "frop" and \
180     blah == 'yeah':
181     blah = 'yeahnah'
182 #: E125
183 # Further indentation required as indentation is not distinguishable
184
185
186 def long_function_name(
187     var_one, var_two, var_three,
188     var_four):
189     print(var_one)
190 #
191 #: E125
192
193
194 def qualify_by_address(
195     self, cr, uid, ids, context=None,
196     params_to_check=frozenset(QUALIF_BY_ADDRESS_PARAM)):
197     """ This gets called by the web server """
198 #: E129
199 if (a == 2 or
200     b == "abc def ghi"
201     "jkl mno"):
202     return True
203 #:
204
205
206 #: E126
207 my_list = [
208     1, 2, 3,
209     4, 5, 6,
210         ]
211 #: E126
212 abris = 3 + \
213         4 + \
214         5 + 6
215 #: E126
216 fixed = re.sub(r'\t+', ' ', target[c::-1], 1)[::-1] + \
217         target[c + 1:]
218 #: E126 E126
219 rv.update(dict.fromkeys((
220             'qualif_nr', 'reasonComment_en', 'reasonComment_fr',
221             'reasonComment_de', 'reasonComment_it'),
222         '?'),
223     "foo")
224 #: E126
225 eat_a_dict_a_day({
226         "foo": "bar",
227 })
228 #: E126
229 if (
230     x == (
231             3
232     ) or
233         y == 4):
234     pass
235 #: E126
236 if (
237     x == (
238         3
239     ) or
240     x == (
241             3
242     ) or
243         y == 4):
244     pass
245 #: E131
246 troublesome_hash = {
247     "hash": "value",
248     "long": "the quick brown fox jumps over the lazy dog before doing a "
249         "somersault",
250 }
251 #:
252
253
254 #: E128
255 # Arguments on first line forbidden when not using vertical alignment
256 foo = long_function_name(var_one, var_two,
257     var_three, var_four)
258 #
259 #: E128
260 print('l.%s\t%s\t%s\t%r' %
261     (token[2][0], pos, tokenize.tok_name[token[0]], token[1]))
262 #: E128
263
264
265 def qualify_by_address(self, cr, uid, ids, context=None,
266         params_to_check=frozenset(QUALIF_BY_ADDRESS_PARAM)):
267     """ This gets called by the web server """
268 #:
269
270
271 #: E128
272 foo(1, 2, 3,
273 4, 5, 6)
274 #: E128
275 foo(1, 2, 3,
276  4, 5, 6)
277 #: E128
278 foo(1, 2, 3,
279   4, 5, 6)
280 #: E128
281 foo(1, 2, 3,
282    4, 5, 6)
283 #: E127
284 foo(1, 2, 3,
285      4, 5, 6)
286 #: E127
287 foo(1, 2, 3,
288       4, 5, 6)
289 #: E127
290 foo(1, 2, 3,
291        4, 5, 6)
292 #: E127
293 foo(1, 2, 3,
294         4, 5, 6)
295 #: E127
296 foo(1, 2, 3,
297          4, 5, 6)
298 #: E127
299 foo(1, 2, 3,
300           4, 5, 6)
301 #: E127
302 foo(1, 2, 3,
303            4, 5, 6)
304 #: E127
305 foo(1, 2, 3,
306             4, 5, 6)
307 #: E127
308 foo(1, 2, 3,
309              4, 5, 6)
310 #: E128 E128
311 if line_removed:
312     self.event(cr, uid,
313               name="Removing the option for contract",
314               description="contract line has been removed",
315                )
316 #: E124 E127 E127
317 if line_removed:
318     self.event(cr, uid,
319                 name="Removing the option for contract",
320                 description="contract line has been removed",
321                 )
322 #: E127
323 rv.update(d=('a', 'b', 'c'),
324              e=42)
325 #
326 #: E127
327 rv.update(d=('a' + 'b', 'c'),
328           e=42, f=42
329                  + 42)
330 #: E127
331 input1 = {'a': {'calc': 1 + 2}, 'b': 1
332                           + 42}
333 #: E128
334 rv.update(d=('a' + 'b', 'c'),
335           e=42, f=(42
336                  + 42))
337 #: E123
338 if True:
339     def example_issue254():
340         return [node.copy(
341             (
342                 replacement
343                 # First, look at all the node's current children.
344                 for child in node.children
345                 # Replace them.
346                 for replacement in replace(child)
347                 ),
348             dict(name=token.undefined)
349         )]
350 #: E125:2:5 E125:8:5
351 if ("""
352     """):
353     pass
354
355 for foo in """
356     abc
357     123
358     """.strip().split():
359     print(foo)
360 #: E122:6:5 E122:7:5 E122:8:1
361 print dedent(
362     '''
363         mkdir -p ./{build}/
364         mv ./build/ ./{build}/%(revision)s/
365     '''.format(
366     build='build',
367     # more stuff
368 )
369 )
370 #: E701:1:8 E122:2:1 E203:4:8 E128:5:1
371 if True:\
372 print(True)
373
374 print(a
375 , end=' ')
376 #: