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

Bump sphinx from 5.2.3 to 5.3.0 in /docs (#3333)
[etc/vim.git] / tests / data / simple_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
177 def multiline_backslash_3():
178   '''
179   already escaped \\ '''
180
181
182 def my_god_its_full_of_stars_1():
183     "I'm sorry Dave\u2001"
184
185
186 # the space below is actually a \u2001, removed in output
187 def my_god_its_full_of_stars_2():
188     "I'm sorry Dave "
189
190
191 def docstring_almost_at_line_limit():
192     """long docstring................................................................."""
193
194
195 def docstring_almost_at_line_limit2():
196     """long docstring.................................................................
197
198     ..................................................................................
199     """
200
201
202 def docstring_at_line_limit():
203     """long docstring................................................................"""
204
205
206 def multiline_docstring_at_line_limit():
207     """first line-----------------------------------------------------------------------
208
209     second line----------------------------------------------------------------------"""
210
211
212 def stable_quote_normalization_with_immediate_inner_single_quote(self):
213     ''''<text here>
214
215     <text here, since without another non-empty line black is stable>
216     '''
217
218
219 # output
220
221 class MyClass:
222     """Multiline
223     class docstring
224     """
225
226     def method(self):
227         """Multiline
228         method docstring
229         """
230         pass
231
232
233 def foo():
234     """This is a docstring with
235     some lines of text here
236     """
237     return
238
239
240 def bar():
241     """This is another docstring
242     with more lines of text
243     """
244     return
245
246
247 def baz():
248     '''"This" is a string with some
249     embedded "quotes"'''
250     return
251
252
253 def troz():
254     """Indentation with tabs
255     is just as OK
256     """
257     return
258
259
260 def zort():
261     """Another
262     multiline
263     docstring
264     """
265     pass
266
267
268 def poit():
269     """
270     Lorem ipsum dolor sit amet.
271
272     Consectetur adipiscing elit:
273      - sed do eiusmod tempor incididunt ut labore
274      - dolore magna aliqua
275        - enim ad minim veniam
276        - quis nostrud exercitation ullamco laboris nisi
277      - aliquip ex ea commodo consequat
278     """
279     pass
280
281
282 def under_indent():
283     """
284       These lines are indented in a way that does not
285     make sense.
286     """
287     pass
288
289
290 def over_indent():
291     """
292     This has a shallow indent
293       - But some lines are deeper
294       - And the closing quote is too deep
295     """
296     pass
297
298
299 def single_line():
300     """But with a newline after it!"""
301     pass
302
303
304 def this():
305     r"""
306     'hey ho'
307     """
308
309
310 def that():
311     """ "hey yah" """
312
313
314 def and_that():
315     """
316     "hey yah" """
317
318
319 def and_this():
320     '''
321     "hey yah"'''
322
323
324 def multiline_whitespace():
325     """ """
326
327
328 def oneline_whitespace():
329     """ """
330
331
332 def empty():
333     """"""
334
335
336 def single_quotes():
337     "testing"
338
339
340 def believe_it_or_not_this_is_in_the_py_stdlib():
341     '''
342     "hey yah"'''
343
344
345 def ignored_docstring():
346     """a => \
347 b"""
348
349
350 def single_line_docstring_with_whitespace():
351     """This should be stripped"""
352
353
354 def docstring_with_inline_tabs_and_space_indentation():
355     """hey
356
357     tab separated       value
358         tab at start of line and then a tab     separated       value
359                                 multiple tabs at the beginning  and     inline
360                         mixed tabs and spaces at beginning. next line has mixed tabs and spaces only.
361
362     line ends with some tabs
363     """
364
365
366 def docstring_with_inline_tabs_and_tab_indentation():
367     """hey
368
369     tab separated       value
370             tab at start of line and then a tab separated       value
371                                     multiple tabs at the beginning      and     inline
372                             mixed tabs and spaces at beginning. next line has mixed tabs and spaces only.
373
374     line ends with some tabs
375     """
376     pass
377
378
379 def backslash_space():
380     """\ """
381
382
383 def multiline_backslash_1():
384     """
385   hey\there\
386   \ """
387
388
389 def multiline_backslash_2():
390     """
391     hey there \ """
392
393
394 def multiline_backslash_3():
395     """
396     already escaped \\"""
397
398
399 def my_god_its_full_of_stars_1():
400     "I'm sorry Dave\u2001"
401
402
403 # the space below is actually a \u2001, removed in output
404 def my_god_its_full_of_stars_2():
405     "I'm sorry Dave"
406
407
408 def docstring_almost_at_line_limit():
409     """long docstring................................................................."""
410
411
412 def docstring_almost_at_line_limit2():
413     """long docstring.................................................................
414
415     ..................................................................................
416     """
417
418
419 def docstring_at_line_limit():
420     """long docstring................................................................"""
421
422
423 def multiline_docstring_at_line_limit():
424     """first line-----------------------------------------------------------------------
425
426     second line----------------------------------------------------------------------"""
427
428
429 def stable_quote_normalization_with_immediate_inner_single_quote(self):
430     """'<text here>
431
432     <text here, since without another non-empty line black is stable>
433     """