Here I come again with docstring requests 😅
Our project follows the NumPy docstring conventions outlined here.
One extremely common mistake our contributors make is the order in which docstring sections appear. Often I'll have to correct docstrings where people put the Returns section after the Examples section, or the Notes section before the Warnings section.
Could ruff autodetect/autofix this?
Before
def cool_function() -> int:
"""
Description.
Notes
-----
Important edge case.
Warnings
--------
Be aware of this requirement!
Returns
-------
int
"""
After
def cool_function() -> int:
"""
Description.
Returns
-------
int
Warnings
--------
Be aware of this requirement!
Notes
-----
Important edge case.
"""
Here I come again with docstring requests 😅
Our project follows the NumPy docstring conventions outlined here.
One extremely common mistake our contributors make is the order in which docstring sections appear. Often I'll have to correct docstrings where people put the
Returnssection after theExamplessection, or theNotessection before theWarningssection.Could ruff autodetect/autofix this?
Before
After