---
source: crates/ruff/src/rules/pydocstyle/mod.rs
---
sections.py:42:5: D407 [*] Missing dashed underline after section ("Returns")
   |
42 |   @expect("D407: Missing dashed underline after section ('Returns')")
43 |   def no_underline():  # noqa: D416
44 |       """Toggle the gizmo.
   |  _____^
45 | | 
46 | |     Returns
47 | |     A value of some sort.
48 | | 
49 | |     """
   | |_______^ D407
   |
   = help: Add dashed line under "Returns"

ℹ Suggested fix
42 42 |     """Toggle the gizmo.
43 43 | 
44 44 |     Returns
   45 |+    -------
45 46 |     A value of some sort.
46 47 | 
47 48 |     """

sections.py:54:5: D407 [*] Missing dashed underline after section ("Returns")
   |
54 |   @expect("D414: Section has no content ('Returns')")
55 |   def no_underline_and_no_description():  # noqa: D416
56 |       """Toggle the gizmo.
   |  _____^
57 | | 
58 | |     Returns
59 | | 
60 | |     """
   | |_______^ D407
   |
   = help: Add dashed line under "Returns"

ℹ Suggested fix
54 54 |     """Toggle the gizmo.
55 55 | 
56 56 |     Returns
   57 |+    -------
57 58 | 
58 59 |     """
59 60 | 

sections.py:65:5: D407 [*] Missing dashed underline after section ("Returns")
   |
65 |   @expect("D414: Section has no content ('Returns')")
66 |   def no_underline_and_no_newline():  # noqa: D416
67 |       """Toggle the gizmo.
   |  _____^
68 | | 
69 | |     Returns"""
   | |______________^ D407
   |
   = help: Add dashed line under "Returns"

ℹ Suggested fix
64 64 | def no_underline_and_no_newline():  # noqa: D416
65 65 |     """Toggle the gizmo.
66 66 | 
67    |-    Returns"""
   67 |+    Returns
   68 |+    -------"""
68 69 | 
69 70 | 
70 71 | @expect(_D213)

sections.py:216:5: D407 [*] Missing dashed underline after section ("Raises")
    |
216 |   @expect("D407: Missing dashed underline after section ('Raises')")
217 |   def multiple_sections():  # noqa: D416
218 |       """Toggle the gizmo.
    |  _____^
219 | | 
220 | |     Short summary
221 | |     -------------
222 | | 
223 | |     This is the function's description, which will also specify what it
224 | |     returns.
225 | | 
226 | |     Returns
227 | |     ------
228 | |     Many many wonderful things.
229 | |     Raises:
230 | |     My attention.
231 | | 
232 | |     """
    | |_______^ D407
    |
    = help: Add dashed line under "Raises"

ℹ Suggested fix
225 225 |     ------
226 226 |     Many many wonderful things.
227 227 |     Raises:
    228 |+    ------
228 229 |     My attention.
229 230 | 
230 231 |     """

sections.py:261:5: D407 [*] Missing dashed underline after section ("Args")
    |
261 |   @expect("D414: Section has no content ('Returns')")
262 |   def valid_google_style_section():  # noqa: D406, D407
263 |       """Toggle the gizmo.
    |  _____^
264 | | 
265 | |     Args:
266 | |         note: A random string.
267 | | 
268 | |     Returns:
269 | | 
270 | |     Raises:
271 | |         RandomError: A random error that occurs randomly.
272 | | 
273 | |     """
    | |_______^ D407
    |
    = help: Add dashed line under "Args"

ℹ Suggested fix
261 261 |     """Toggle the gizmo.
262 262 | 
263 263 |     Args:
    264 |+    ----
264 265 |         note: A random string.
265 266 | 
266 267 |     Returns:

sections.py:261:5: D407 [*] Missing dashed underline after section ("Returns")
    |
261 |   @expect("D414: Section has no content ('Returns')")
262 |   def valid_google_style_section():  # noqa: D406, D407
263 |       """Toggle the gizmo.
    |  _____^
264 | | 
265 | |     Args:
266 | |         note: A random string.
267 | | 
268 | |     Returns:
269 | | 
270 | |     Raises:
271 | |         RandomError: A random error that occurs randomly.
272 | | 
273 | |     """
    | |_______^ D407
    |
    = help: Add dashed line under "Returns"

ℹ Suggested fix
264 264 |         note: A random string.
265 265 | 
266 266 |     Returns:
    267 |+    -------
267 268 | 
268 269 |     Raises:
269 270 |         RandomError: A random error that occurs randomly.

sections.py:261:5: D407 [*] Missing dashed underline after section ("Raises")
    |
261 |   @expect("D414: Section has no content ('Returns')")
262 |   def valid_google_style_section():  # noqa: D406, D407
263 |       """Toggle the gizmo.
    |  _____^
264 | | 
265 | |     Args:
266 | |         note: A random string.
267 | | 
268 | |     Returns:
269 | | 
270 | |     Raises:
271 | |         RandomError: A random error that occurs randomly.
272 | | 
273 | |     """
    | |_______^ D407
    |
    = help: Add dashed line under "Raises"

ℹ Suggested fix
266 266 |     Returns:
267 267 | 
268 268 |     Raises:
    269 |+    ------
269 270 |         RandomError: A random error that occurs randomly.
270 271 | 
271 272 |     """

sections.py:278:5: D407 [*] Missing dashed underline after section ("Args")
    |
278 |           "('Args:', not 'Args')")
279 |   def missing_colon_google_style_section():  # noqa: D406, D407
280 |       """Toggle the gizmo.
    |  _____^
281 | | 
282 | |     Args
283 | |         note: A random string.
284 | | 
285 | |     """
    | |_______^ D407
    |
    = help: Add dashed line under "Args"

ℹ Suggested fix
278 278 |     """Toggle the gizmo.
279 279 | 
280 280 |     Args
    281 |+    ----
281 282 |         note: A random string.
282 283 | 
283 284 |     """

sections.py:293:9: D407 [*] Missing dashed underline after section ("Args")
    |
293 |       def bar(y=2):  # noqa: D207, D213, D406, D407
294 |           """Nested function test for docstrings.
    |  _________^
295 | | 
296 | |         Will this work when referencing x?
297 | | 
298 | |         Args:
299 | |             x: Test something
300 | | that is broken.
301 | | 
302 | |         """
    | |___________^ D407
303 |           print(x)
    |
    = help: Add dashed line under "Args"

ℹ Suggested fix
295 295 |         Will this work when referencing x?
296 296 | 
297 297 |         Args:
    298 |+        ----
298 299 |             x: Test something
299 300 | that is broken.
300 301 | 

sections.py:310:5: D407 [*] Missing dashed underline after section ("Args")
    |
310 |           "'test_missing_google_args' docstring)")
311 |   def test_missing_google_args(x=1, y=2, _private=3):  # noqa: D406, D407
312 |       """Toggle the gizmo.
    |  _____^
313 | | 
314 | |     Args:
315 | |         x (int): The greatest integer.
316 | | 
317 | |     """
    | |_______^ D407
    |
    = help: Add dashed line under "Args"

ℹ Suggested fix
310 310 |     """Toggle the gizmo.
311 311 | 
312 312 |     Args:
    313 |+    ----
313 314 |         x (int): The greatest integer.
314 315 | 
315 316 |     """

sections.py:322:9: D407 [*] Missing dashed underline after section ("Args")
    |
322 |       def test_method(self, test, another_test, _):  # noqa: D213, D407
323 |           """Test a valid args section.
    |  _________^
324 | | 
325 | |         Args:
326 | |             test: A parameter.
327 | |             another_test: Another parameter.
328 | | 
329 | |         """
    | |___________^ D407
330 |   
331 |       @expect("D417: Missing argument descriptions in the docstring "
    |
    = help: Add dashed line under "Args"

ℹ Suggested fix
322 322 |         """Test a valid args section.
323 323 | 
324 324 |         Args:
    325 |+        ----
325 326 |             test: A parameter.
326 327 |             another_test: Another parameter.
327 328 | 

sections.py:334:9: D407 [*] Missing dashed underline after section ("Args")
    |
334 |               "'test_missing_args' docstring)", arg_count=5)
335 |       def test_missing_args(self, test, x, y, z=3, _private_arg=3):  # noqa: D213, D407
336 |           """Test a valid args section.
    |  _________^
337 | | 
338 | |         Args:
339 | |             x: Another parameter.
340 | | 
341 | |         """
    | |___________^ D407
342 |   
343 |       @classmethod
    |
    = help: Add dashed line under "Args"

ℹ Suggested fix
334 334 |         """Test a valid args section.
335 335 | 
336 336 |         Args:
    337 |+        ----
337 338 |             x: Another parameter.
338 339 | 
339 340 |         """

sections.py:346:9: D407 [*] Missing dashed underline after section ("Args")
    |
346 |               "'test_missing_args_class_method' docstring)", arg_count=5)
347 |       def test_missing_args_class_method(cls, test, x, y, _, z=3):  # noqa: D213, D407
348 |           """Test a valid args section.
    |  _________^
349 | | 
350 | |         Args:
351 | |             x: Another parameter. The parameter below is missing description.
352 | |             y:
353 | | 
354 | |         """
    | |___________^ D407
355 |   
356 |       @staticmethod
    |
    = help: Add dashed line under "Args"

ℹ Suggested fix
346 346 |         """Test a valid args section.
347 347 | 
348 348 |         Args:
    349 |+        ----
349 350 |             x: Another parameter. The parameter below is missing description.
350 351 |             y:
351 352 | 

sections.py:359:9: D407 [*] Missing dashed underline after section ("Args")
    |
359 |               "'test_missing_args_static_method' docstring)", arg_count=4)
360 |       def test_missing_args_static_method(a, x, y, _test, z=3):  # noqa: D213, D407
361 |           """Test a valid args section.
    |  _________^
362 | | 
363 | |         Args:
364 | |             x: Another parameter.
365 | | 
366 | |         """
    | |___________^ D407
367 |   
368 |       @staticmethod
    |
    = help: Add dashed line under "Args"

ℹ Suggested fix
359 359 |         """Test a valid args section.
360 360 | 
361 361 |         Args:
    362 |+        ----
362 363 |             x: Another parameter.
363 364 | 
364 365 |         """

sections.py:371:9: D407 [*] Missing dashed underline after section ("Args")
    |
371 |               "'test_missing_docstring' docstring)", arg_count=2)
372 |       def test_missing_docstring(a, b):  # noqa: D213, D407
373 |           """Test a valid args section.
    |  _________^
374 | | 
375 | |         Args:
376 | |             a:
377 | | 
378 | |         """
    | |___________^ D407
379 |   
380 |       @staticmethod
    |
    = help: Add dashed line under "Args"

ℹ Suggested fix
371 371 |         """Test a valid args section.
372 372 | 
373 373 |         Args:
    374 |+        ----
374 375 |             a:
375 376 | 
376 377 |         """

sections.py:380:9: D407 [*] Missing dashed underline after section ("Args")
    |
380 |       @staticmethod
381 |       def test_hanging_indent(skip, verbose):  # noqa: D213, D407
382 |           """Do stuff.
    |  _________^
383 | | 
384 | |         Args:
385 | |             skip (:attr:`.Skip`):
386 | |                 Lorem ipsum dolor sit amet, consectetur adipiscing elit.
387 | |                 Etiam at tellus a tellus faucibus maximus. Curabitur tellus
388 | |                 mauris, semper id vehicula ac, feugiat ut tortor.
389 | |             verbose (bool):
390 | |                 If True, print out as much information as possible.
391 | |                 If False, print out concise "one-liner" information.
392 | | 
393 | |         """
    | |___________^ D407
    |
    = help: Add dashed line under "Args"

ℹ Suggested fix
380 380 |         """Do stuff.
381 381 | 
382 382 |         Args:
    383 |+        ----
383 384 |             skip (:attr:`.Skip`):
384 385 |                 Lorem ipsum dolor sit amet, consectetur adipiscing elit.
385 386 |                 Etiam at tellus a tellus faucibus maximus. Curabitur tellus

sections.py:499:9: D407 [*] Missing dashed underline after section ("Args")
    |
499 |               "'test_incorrect_indent' docstring)", arg_count=3)
500 |       def test_incorrect_indent(self, x=1, y=2):  # noqa: D207, D213, D407
501 |           """Reproducing issue #437.
    |  _________^
502 | | 
503 | | Testing this incorrectly indented docstring.
504 | | 
505 | |         Args:
506 | |             x: Test argument.
507 | | 
508 | |         """
    | |___________^ D407
    |
    = help: Add dashed line under "Args"

ℹ Suggested fix
501 501 | Testing this incorrectly indented docstring.
502 502 | 
503 503 |         Args:
    504 |+        ----
504 505 |             x: Test argument.
505 506 | 
506 507 |         """


