---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
D.py:200:5: D213 [*] Multi-line docstring summary should start at the second line
    |
198 |   @expect('D213: Multi-line docstring summary should start at the second line')
199 |   def multi_line_zero_separating_blanks():
200 |       """Summary.
    |  _____^
201 | |     Description.
202 | | 
203 | |     """
    | |_______^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
197 197 |         '(found 0)')
198 198 | @expect('D213: Multi-line docstring summary should start at the second line')
199 199 | def multi_line_zero_separating_blanks():
200     |-    """Summary.
    200 |+    """
    201 |+    Summary.
201 202 |     Description.
202 203 | 
203 204 |     """

D.py:210:5: D213 [*] Multi-line docstring summary should start at the second line
    |
208 |   @expect('D213: Multi-line docstring summary should start at the second line')
209 |   def multi_line_two_separating_blanks():
210 |       """Summary.
    |  _____^
211 | | 
212 | | 
213 | |     Description.
214 | | 
215 | |     """
    | |_______^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
207 207 |         '(found 2)')
208 208 | @expect('D213: Multi-line docstring summary should start at the second line')
209 209 | def multi_line_two_separating_blanks():
210     |-    """Summary.
    210 |+    """
    211 |+    Summary.
211 212 | 
212 213 | 
213 214 |     Description.

D.py:220:5: D213 [*] Multi-line docstring summary should start at the second line
    |
218 |   @expect('D213: Multi-line docstring summary should start at the second line')
219 |   def multi_line_one_separating_blanks():
220 |       """Summary.
    |  _____^
221 | | 
222 | |     Description.
223 | | 
224 | |     """
    | |_______^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
217 217 | 
218 218 | @expect('D213: Multi-line docstring summary should start at the second line')
219 219 | def multi_line_one_separating_blanks():
220     |-    """Summary.
    220 |+    """
    221 |+    Summary.
221 222 | 
222 223 |     Description.
223 224 | 

D.py:230:5: D213 [*] Multi-line docstring summary should start at the second line
    |
228 |   @expect('D213: Multi-line docstring summary should start at the second line')
229 |   def asdfsdf():
230 |       """Summary.
    |  _____^
231 | | 
232 | | Description.
233 | | 
234 | |     """
    | |_______^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
227 227 | @expect('D207: Docstring is under-indented')
228 228 | @expect('D213: Multi-line docstring summary should start at the second line')
229 229 | def asdfsdf():
230     |-    """Summary.
    230 |+    """
    231 |+    Summary.
231 232 | 
232 233 | Description.
233 234 | 

D.py:240:5: D213 [*] Multi-line docstring summary should start at the second line
    |
238 |   @expect('D213: Multi-line docstring summary should start at the second line')
239 |   def asdsdfsdffsdf():
240 |       """Summary.
    |  _____^
241 | | 
242 | |     Description.
243 | | 
244 | | """
    | |___^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
237 237 | @expect('D207: Docstring is under-indented')
238 238 | @expect('D213: Multi-line docstring summary should start at the second line')
239 239 | def asdsdfsdffsdf():
240     |-    """Summary.
    240 |+    """
    241 |+    Summary.
241 242 | 
242 243 |     Description.
243 244 | 

D.py:250:5: D213 [*] Multi-line docstring summary should start at the second line
    |
248 |   @expect('D213: Multi-line docstring summary should start at the second line')
249 |   def asdfsdsdf24():
250 |       """Summary.
    |  _____^
251 | | 
252 | |        Description.
253 | | 
254 | |     """
    | |_______^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
247 247 | @expect('D208: Docstring is over-indented')
248 248 | @expect('D213: Multi-line docstring summary should start at the second line')
249 249 | def asdfsdsdf24():
250     |-    """Summary.
    250 |+    """
    251 |+    Summary.
251 252 | 
252 253 |        Description.
253 254 | 

D.py:260:5: D213 [*] Multi-line docstring summary should start at the second line
    |
258 |   @expect('D213: Multi-line docstring summary should start at the second line')
259 |   def asdfsdsdfsdf24():
260 |       """Summary.
    |  _____^
261 | | 
262 | |     Description.
263 | | 
264 | |         """
    | |___________^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
257 257 | @expect('D208: Docstring is over-indented')
258 258 | @expect('D213: Multi-line docstring summary should start at the second line')
259 259 | def asdfsdsdfsdf24():
260     |-    """Summary.
    260 |+    """
    261 |+    Summary.
261 262 | 
262 263 |     Description.
263 264 | 

D.py:270:5: D213 [*] Multi-line docstring summary should start at the second line
    |
268 |   @expect('D213: Multi-line docstring summary should start at the second line')
269 |   def asdfsdfsdsdsdfsdf24():
270 |       """Summary.
    |  _____^
271 | | 
272 | |         Description.
273 | | 
274 | |     """
    | |_______^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
267 267 | @expect('D208: Docstring is over-indented')
268 268 | @expect('D213: Multi-line docstring summary should start at the second line')
269 269 | def asdfsdfsdsdsdfsdf24():
270     |-    """Summary.
    270 |+    """
    271 |+    Summary.
271 272 | 
272 273 |         Description.
273 274 | 

D.py:281:5: D213 [*] Multi-line docstring summary should start at the second line
    |
279 |   @expect('D213: Multi-line docstring summary should start at the second line')
280 |   def asdfljdf24():
281 |       """Summary.
    |  _____^
282 | | 
283 | |     Description."""
    | |___________________^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
278 278 |         'line')
279 279 | @expect('D213: Multi-line docstring summary should start at the second line')
280 280 | def asdfljdf24():
281     |-    """Summary.
    281 |+    """
    282 |+    Summary.
282 283 | 
283 284 |     Description."""
284 285 | 

D.py:299:5: D213 [*] Multi-line docstring summary should start at the second line
    |
297 |   @expect('D213: Multi-line docstring summary should start at the second line')
298 |   def multiline():
299 |       """ Whitespace at the beginning.
    |  _____^
300 | | 
301 | |     This is the end.
302 | |     """
    | |_______^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
296 296 | @expect('D210: No whitespaces allowed surrounding docstring text')
297 297 | @expect('D213: Multi-line docstring summary should start at the second line')
298 298 | def multiline():
299     |-    """ Whitespace at the beginning.
    299 |+    """
    300 |+    Whitespace at the beginning.
300 301 | 
301 302 |     This is the end.
302 303 |     """

D.py:343:5: D213 [*] Multi-line docstring summary should start at the second line
    |
341 |   @expect('D213: Multi-line docstring summary should start at the second line')
342 |   def exceptions_of_D301():
343 |       """Exclude some backslashes from D301.
    |  _____^
344 | | 
345 | |     In particular, line continuations \
346 | |     and unicode literals \u0394 and \N{GREEK CAPITAL LETTER DELTA}.
347 | |     They are considered to be intentionally unescaped.
348 | |     """
    | |_______^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
340 340 | 
341 341 | @expect('D213: Multi-line docstring summary should start at the second line')
342 342 | def exceptions_of_D301():
343     |-    """Exclude some backslashes from D301.
    343 |+    """
    344 |+    Exclude some backslashes from D301.
344 345 | 
345 346 |     In particular, line continuations \
346 347 |     and unicode literals \u0394 and \N{GREEK CAPITAL LETTER DELTA}.

D.py:383:5: D213 [*] Multi-line docstring summary should start at the second line
    |
381 |   @expect('D213: Multi-line docstring summary should start at the second line')
382 |   def new_209():
383 |       """First line.
    |  _____^
384 | | 
385 | |     More lines.
386 | |     """
    | |_______^ D213
387 |       pass
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
380 380 | 
381 381 | @expect('D213: Multi-line docstring summary should start at the second line')
382 382 | def new_209():
383     |-    """First line.
    383 |+    """
    384 |+    First line.
384 385 | 
385 386 |     More lines.
386 387 |     """

D.py:392:5: D213 [*] Multi-line docstring summary should start at the second line
    |
390 |   @expect('D213: Multi-line docstring summary should start at the second line')
391 |   def old_209():
392 |       """One liner.
    |  _____^
393 | | 
394 | |     Multi-line comments. OK to have extra blank line
395 | | 
396 | |     """
    | |_______^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
389 389 | 
390 390 | @expect('D213: Multi-line docstring summary should start at the second line')
391 391 | def old_209():
392     |-    """One liner.
    392 |+    """
    393 |+    One liner.
393 394 | 
394 395 |     Multi-line comments. OK to have extra blank line
395 396 | 

D.py:438:37: D213 [*] Multi-line docstring summary should start at the second line
    |
436 |   @expect("D207: Docstring is under-indented")
437 |   @expect('D213: Multi-line docstring summary should start at the second line')
438 |   def docstring_start_in_same_line(): """First Line.
    |  _____________________________________^
439 | | 
440 | |     Second Line
441 | |     """
    | |_______^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
435 435 | 
436 436 | @expect("D207: Docstring is under-indented")
437 437 | @expect('D213: Multi-line docstring summary should start at the second line')
438     |-def docstring_start_in_same_line(): """First Line.
    438 |+def docstring_start_in_same_line(): """
    439 |+    First Line.
439 440 | 
440 441 |     Second Line
441 442 |     """

D.py:450:5: D213 [*] Multi-line docstring summary should start at the second line
    |
448 |   @expect('D213: Multi-line docstring summary should start at the second line')
449 |   def a_following_valid_function(x=None):
450 |       """Check for a bug where the previous function caused an assertion.
    |  _____^
451 | | 
452 | |     The assertion was caused in the next function, so this one is necessary.
453 | | 
454 | |     """
    | |_______^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
447 447 | 
448 448 | @expect('D213: Multi-line docstring summary should start at the second line')
449 449 | def a_following_valid_function(x=None):
450     |-    """Check for a bug where the previous function caused an assertion.
    450 |+    """
    451 |+    Check for a bug where the previous function caused an assertion.
451 452 | 
452 453 |     The assertion was caused in the next function, so this one is necessary.
453 454 | 

D.py:526:5: D213 [*] Multi-line docstring summary should start at the second line
    |
524 |   # parameters as functions for Google / Numpy conventions.
525 |   class Blah:  # noqa: D203,D213
526 |       """A Blah.
    |  _____^
527 | | 
528 | |     Parameters
529 | |     ----------
530 | |     x : int
531 | | 
532 | |     """
    | |_______^ D213
533 |   
534 |       def __init__(self, x):
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
523 523 | # This is reproducing a bug where AttributeError is raised when parsing class
524 524 | # parameters as functions for Google / Numpy conventions.
525 525 | class Blah:  # noqa: D203,D213
526     |-    """A Blah.
    526 |+    """
    527 |+    A Blah.
527 528 | 
528 529 |     Parameters
529 530 |     ----------

D.py:546:5: D213 [*] Multi-line docstring summary should start at the second line
    |
544 |   def multiline_leading_space():
545 |   
546 |       """Leading space.
    |  _____^
547 | | 
548 | |     More content.
549 | |     """
    | |_______^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
543 543 | @expect('D213: Multi-line docstring summary should start at the second line')
544 544 | def multiline_leading_space():
545 545 | 
546     |-    """Leading space.
    546 |+    """
    547 |+    Leading space.
547 548 | 
548 549 |     More content.
549 550 |     """

D.py:555:5: D213 [*] Multi-line docstring summary should start at the second line
    |
553 |   @expect('D213: Multi-line docstring summary should start at the second line')
554 |   def multiline_trailing_space():
555 |       """Leading space.
    |  _____^
556 | | 
557 | |     More content.
558 | |     """
    | |_______^ D213
559 |   
560 |       pass
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
552 552 | @expect('D202: No blank lines allowed after function docstring (found 1)')
553 553 | @expect('D213: Multi-line docstring summary should start at the second line')
554 554 | def multiline_trailing_space():
555     |-    """Leading space.
    555 |+    """
    556 |+    Leading space.
556 557 | 
557 558 |     More content.
558 559 |     """

D.py:568:5: D213 [*] Multi-line docstring summary should start at the second line
    |
566 |   def multiline_trailing_and_leading_space():
567 |   
568 |       """Trailing and leading space.
    |  _____^
569 | | 
570 | |     More content.
571 | |     """
    | |_______^ D213
572 |   
573 |       pass
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
565 565 | @expect('D213: Multi-line docstring summary should start at the second line')
566 566 | def multiline_trailing_and_leading_space():
567 567 | 
568     |-    """Trailing and leading space.
    568 |+    """
    569 |+    Trailing and leading space.
569 570 | 
570 571 |     More content.
571 572 |     """

D.py:588:5: D213 [*] Multi-line docstring summary should start at the second line
    |
586 |   @expect('D213: Multi-line docstring summary should start at the second line')
587 |   def asdfljdjgf24():
588 |       """Summary.
    |  _____^
589 | | 
590 | |     Description.  """
    | |_____________________^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
585 585 |         'line')
586 586 | @expect('D213: Multi-line docstring summary should start at the second line')
587 587 | def asdfljdjgf24():
588     |-    """Summary.
    588 |+    """
    589 |+    Summary.
589 590 | 
590 591 |     Description.  """
591 592 | 

D.py:606:5: D213 [*] Multi-line docstring summary should start at the second line
    |
604 |   @expect('D212: Multi-line docstring summary should start at the first line')
605 |   def one_liner():
606 |       r"""Wrong.
    |  _____^
607 | | 
608 | |     """
    | |_______^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
603 603 |         '(found 3)')
604 604 | @expect('D212: Multi-line docstring summary should start at the first line')
605 605 | def one_liner():
606     |-    r"""Wrong.
    606 |+    r"""
    607 |+    Wrong.
607 608 | 
608 609 |     """
609 610 | 

D.py:615:5: D213 [*] Multi-line docstring summary should start at the second line
    |
613 |   @expect('D212: Multi-line docstring summary should start at the first line')
614 |   def one_liner():
615 |       """Wrong."
    |  _____^
616 | | 
617 | |     """
    | |_______^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
612 612 |         '(found 3)')
613 613 | @expect('D212: Multi-line docstring summary should start at the first line')
614 614 | def one_liner():
615     |-    """Wrong."
    615 |+    """
    616 |+    Wrong."
616 617 | 
617 618 |     """
618 619 | 

D.py:671:5: D213 [*] Multi-line docstring summary should start at the second line
    |
670 |   def retain_extra_whitespace():
671 |       """Summary.
    |  _____^
672 | | 
673 | |         This is overindented
674 | |             And so is this, but it we should preserve the extra space on this line relative
675 | |             to the one before
676 | |     """
    | |_______^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
668 668 | 
669 669 | 
670 670 | def retain_extra_whitespace():
671     |-    """Summary.
    671 |+    """
    672 |+    Summary.
672 673 | 
673 674 |         This is overindented
674 675 |             And so is this, but it we should preserve the extra space on this line relative

D.py:680:5: D213 [*] Multi-line docstring summary should start at the second line
    |
679 |   def retain_extra_whitespace_multiple():
680 |       """Summary.
    |  _____^
681 | | 
682 | |         This is overindented
683 | |             And so is this, but it we should preserve the extra space on this line relative
684 | |             to the one before
685 | |         This is also overindented
686 | |             And so is this, but it we should preserve the extra space on this line relative
687 | |             to the one before
688 | |     """
    | |_______^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
677 677 | 
678 678 | 
679 679 | def retain_extra_whitespace_multiple():
680     |-    """Summary.
    680 |+    """
    681 |+    Summary.
681 682 | 
682 683 |         This is overindented
683 684 |             And so is this, but it we should preserve the extra space on this line relative

D.py:693:5: D213 [*] Multi-line docstring summary should start at the second line
    |
692 |   def retain_extra_whitespace_deeper():
693 |       """Summary.
    |  _____^
694 | | 
695 | |         This is overindented
696 | |             And so is this, but it we should preserve the extra space on this line relative
697 | |             to the one before
698 | |                 And the relative indent here should be preserved too
699 | |     """
    | |_______^ D213
700 |   
701 |   def retain_extra_whitespace_followed_by_same_offset():
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
690 690 | 
691 691 | 
692 692 | def retain_extra_whitespace_deeper():
693     |-    """Summary.
    693 |+    """
    694 |+    Summary.
694 695 | 
695 696 |         This is overindented
696 697 |             And so is this, but it we should preserve the extra space on this line relative

D.py:702:5: D213 [*] Multi-line docstring summary should start at the second line
    |
701 |   def retain_extra_whitespace_followed_by_same_offset():
702 |       """Summary.
    |  _____^
703 | | 
704 | |         This is overindented
705 | |             And so is this, but it we should preserve the extra space on this line relative
706 | |         This is overindented
707 | |         This is overindented
708 | |     """
    | |_______^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
699 699 |     """
700 700 | 
701 701 | def retain_extra_whitespace_followed_by_same_offset():
702     |-    """Summary.
    702 |+    """
    703 |+    Summary.
703 704 | 
704 705 |         This is overindented
705 706 |             And so is this, but it we should preserve the extra space on this line relative

D.py:712:5: D213 [*] Multi-line docstring summary should start at the second line
    |
711 |   def retain_extra_whitespace_not_overindented():
712 |       """Summary.
    |  _____^
713 | | 
714 | |     This is not overindented
715 | |         This is overindented, but since one line is not overindented this should not raise
716 | |             And so is this, but it we should preserve the extra space on this line relative
717 | |     """
    | |_______^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
709 709 | 
710 710 | 
711 711 | def retain_extra_whitespace_not_overindented():
712     |-    """Summary.
    712 |+    """
    713 |+    Summary.
713 714 | 
714 715 |     This is not overindented
715 716 |         This is overindented, but since one line is not overindented this should not raise

D.py:721:5: D213 [*] Multi-line docstring summary should start at the second line
    |
720 |   def inconsistent_indent_byte_size():
721 |       """There's a non-breaking space (2-bytes) after 3 spaces (https://github.com/astral-sh/ruff/issues/9080).
    |  _____^
722 | | 
723 | |        Returns:
724 | |     """
    | |_______^ D213
    |
    = help: Insert line break and indentation after opening quotes

ℹ Safe fix
718 718 | 
719 719 | 
720 720 | def inconsistent_indent_byte_size():
721     |-    """There's a non-breaking space (2-bytes) after 3 spaces (https://github.com/astral-sh/ruff/issues/9080).
    721 |+    """
    722 |+    There's a non-breaking space (2-bytes) after 3 spaces (https://github.com/astral-sh/ruff/issues/9080).
722 723 | 
723 724 |        Returns:
724 725 |     """


