-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
acceptedReady for implementationReady for implementationdocstringRelated to docstring linting or formattingRelated to docstring linting or formattingruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
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.
"""Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
acceptedReady for implementationReady for implementationdocstringRelated to docstring linting or formattingRelated to docstring linting or formattingruleImplementing or modifying a lint ruleImplementing or modifying a lint rule