incorrect-section-order (D420)
Preview (since 0.15.3) · Related issues · View source
Derived from the pydocstyle linter.
This rule is unstable and in preview. The --preview flag is required for use.
What it does
Checks for docstring sections that appear out of order.
Why is this bad?
Docstring sections should follow the canonical ordering specified by the docstring convention (NumPy or Google). Consistent ordering makes docstrings easier to read and navigate.
For the NumPy convention, all sections have a prescribed order per the
numpydoc style guide. For the Google convention, only the relative ordering
of Args, Returns/Yields, and Raises is enforced; all other sections
are unordered.
Example
Given lint.pydocstyle.convention = "numpy":
Use instead:
Given lint.pydocstyle.convention = "google":
Use instead: