]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/black/tests/data/cases/docstring.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:

Merge commit '882d8795c6ff65c02f2657e596391748d1b6b7f5'
[etc/vim.git] / .vim / bundle / black / tests / data / cases / docstring.py
1 class MyClass:
2   """ Multiline
3   class docstring
4   """
5
6   def method(self):
7     """Multiline
8     method docstring
9     """
10     pass
11
12
13 def foo():
14   """This is a docstring with             
15   some lines of text here
16   """
17   return
18
19
20 def bar():
21   '''This is another docstring
22   with more lines of text
23   '''
24   return
25
26
27 def baz():
28   '''"This" is a string with some
29   embedded "quotes"'''
30   return
31
32
33 def troz():
34         '''Indentation with tabs
35         is just as OK
36         '''
37         return
38
39
40 def zort():
41         """Another
42         multiline
43         docstring
44         """
45         pass
46
47 def poit():
48   """
49   Lorem ipsum dolor sit amet.       
50
51   Consectetur adipiscing elit:
52    - sed do eiusmod tempor incididunt ut labore
53    - dolore magna aliqua
54      - enim ad minim veniam
55      - quis nostrud exercitation ullamco laboris nisi
56    - aliquip ex ea commodo consequat
57   """
58   pass
59
60
61 def under_indent():
62   """
63   These lines are indented in a way that does not
64 make sense.
65   """
66   pass
67
68
69 def over_indent():
70   """
71   This has a shallow indent
72     - But some lines are deeper
73     - And the closing quote is too deep
74     """
75   pass
76
77
78 def single_line():
79     """But with a newline after it!
80
81     """
82     pass
83
84
85 def this():
86     r"""
87     'hey ho'
88     """
89
90
91 def that():
92   """ "hey yah" """
93
94
95 def and_that():
96   """
97   "hey yah" """
98
99
100 def and_this():
101   ''' 
102   "hey yah"'''
103
104
105 def multiline_whitespace():
106     '''
107     
108     
109     
110     
111     '''
112
113
114 def oneline_whitespace():
115     '''      '''
116
117
118 def empty():
119     """"""
120
121
122 def single_quotes():
123     'testing'
124
125
126 def believe_it_or_not_this_is_in_the_py_stdlib(): ''' 
127 "hey yah"'''
128
129
130 def ignored_docstring():
131     """a => \
132 b"""  
133
134 def single_line_docstring_with_whitespace():
135     """   This should be stripped """
136
137 def docstring_with_inline_tabs_and_space_indentation():
138     """hey
139
140     tab separated       value
141         tab at start of line and then a tab     separated       value
142                                 multiple tabs at the beginning  and     inline
143                         mixed tabs and spaces at beginning. next line has mixed tabs and spaces only.
144                                                 
145     line ends with some tabs            
146     """
147
148
149 def docstring_with_inline_tabs_and_tab_indentation():
150         """hey
151
152         tab     separated       value
153                 tab at start of line and then a tab     separated       value
154                                         multiple tabs at the beginning  and     inline
155                                 mixed tabs and spaces at beginning. next line has mixed tabs and spaces only.
156                                                         
157         line ends with some tabs                
158         """
159         pass
160
161
162 def backslash_space():
163     """\ """
164
165
166 def multiline_backslash_1():
167   '''
168   hey\there\
169   \ '''
170
171
172 def multiline_backslash_2():
173   '''
174   hey there \ '''
175
176 # Regression test for #3425
177 def multiline_backslash_really_long_dont_crash():
178     """
179     hey there hello guten tag hi hoow are you ola zdravstvuyte ciao como estas ca va \ """
180
181
182 def multiline_backslash_3():
183   '''
184   already escaped \\ '''
185
186
187 def my_god_its_full_of_stars_1():
188     "I'm sorry Dave\u2001"
189
190
191 # the space below is actually a \u2001, removed in output
192 def my_god_its_full_of_stars_2():
193     "I'm sorry Dave "
194
195
196 def docstring_almost_at_line_limit():
197     """long docstring................................................................."""
198
199
200 def docstring_almost_at_line_limit2():
201     """long docstring.................................................................
202
203     ..................................................................................
204     """
205
206
207 def docstring_at_line_limit():
208     """long docstring................................................................"""
209
210
211 def multiline_docstring_at_line_limit():
212     """first line-----------------------------------------------------------------------
213
214     second line----------------------------------------------------------------------"""
215
216
217 def stable_quote_normalization_with_immediate_inner_single_quote(self):
218     ''''<text here>
219
220     <text here, since without another non-empty line black is stable>
221     '''
222
223
224 # output
225
226 class MyClass:
227     """Multiline
228     class docstring
229     """
230
231     def method(self):
232         """Multiline
233         method docstring
234         """
235         pass
236
237
238 def foo():
239     """This is a docstring with
240     some lines of text here
241     """
242     return
243
244
245 def bar():
246     """This is another docstring
247     with more lines of text
248     """
249     return
250
251
252 def baz():
253     '''"This" is a string with some
254     embedded "quotes"'''
255     return
256
257
258 def troz():
259     """Indentation with tabs
260     is just as OK
261     """
262     return
263
264
265 def zort():
266     """Another
267     multiline
268     docstring
269     """
270     pass
271
272
273 def poit():
274     """
275     Lorem ipsum dolor sit amet.
276
277     Consectetur adipiscing elit:
278      - sed do eiusmod tempor incididunt ut labore
279      - dolore magna aliqua
280        - enim ad minim veniam
281        - quis nostrud exercitation ullamco laboris nisi
282      - aliquip ex ea commodo consequat
283     """
284     pass
285
286
287 def under_indent():
288     """
289       These lines are indented in a way that does not
290     make sense.
291     """
292     pass
293
294
295 def over_indent():
296     """
297     This has a shallow indent
298       - But some lines are deeper
299       - And the closing quote is too deep
300     """
301     pass
302
303
304 def single_line():
305     """But with a newline after it!"""
306     pass
307
308
309 def this():
310     r"""
311     'hey ho'
312     """
313
314
315 def that():
316     """ "hey yah" """
317
318
319 def and_that():
320     """
321     "hey yah" """
322
323
324 def and_this():
325     '''
326     "hey yah"'''
327
328
329 def multiline_whitespace():
330     """ """
331
332
333 def oneline_whitespace():
334     """ """
335
336
337 def empty():
338     """"""
339
340
341 def single_quotes():
342     "testing"
343
344
345 def believe_it_or_not_this_is_in_the_py_stdlib():
346     '''
347     "hey yah"'''
348
349
350 def ignored_docstring():
351     """a => \
352 b"""
353
354
355 def single_line_docstring_with_whitespace():
356     """This should be stripped"""
357
358
359 def docstring_with_inline_tabs_and_space_indentation():
360     """hey
361
362     tab separated       value
363         tab at start of line and then a tab     separated       value
364                                 multiple tabs at the beginning  and     inline
365                         mixed tabs and spaces at beginning. next line has mixed tabs and spaces only.
366
367     line ends with some tabs
368     """
369
370
371 def docstring_with_inline_tabs_and_tab_indentation():
372     """hey
373
374     tab separated       value
375             tab at start of line and then a tab separated       value
376                                     multiple tabs at the beginning      and     inline
377                             mixed tabs and spaces at beginning. next line has mixed tabs and spaces only.
378
379     line ends with some tabs
380     """
381     pass
382
383
384 def backslash_space():
385     """\ """
386
387
388 def multiline_backslash_1():
389     """
390   hey\there\
391   \ """
392
393
394 def multiline_backslash_2():
395     """
396     hey there \ """
397
398
399 # Regression test for #3425
400 def multiline_backslash_really_long_dont_crash():
401     """
402     hey there hello guten tag hi hoow are you ola zdravstvuyte ciao como estas ca va \ """
403
404
405 def multiline_backslash_3():
406     """
407     already escaped \\"""
408
409
410 def my_god_its_full_of_stars_1():
411     "I'm sorry Dave\u2001"
412
413
414 # the space below is actually a \u2001, removed in output
415 def my_god_its_full_of_stars_2():
416     "I'm sorry Dave"
417
418
419 def docstring_almost_at_line_limit():
420     """long docstring................................................................."""
421
422
423 def docstring_almost_at_line_limit2():
424     """long docstring.................................................................
425
426     ..................................................................................
427     """
428
429
430 def docstring_at_line_limit():
431     """long docstring................................................................"""
432
433
434 def multiline_docstring_at_line_limit():
435     """first line-----------------------------------------------------------------------
436
437     second line----------------------------------------------------------------------"""
438
439
440 def stable_quote_normalization_with_immediate_inner_single_quote(self):
441     """'<text here>
442
443     <text here, since without another non-empty line black is stable>
444     """