]> 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:

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