Feature request: Support numpy docstring convention #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First of all, thanks for your efforts on this package, I've been looking for a tool to do this kind of checking for quite a while. My only issue is that the numpy docstring convention (that I use) is not compatible with the way this package currently checks for sections and subsections.
As an example, here is a function in my code I tested
flake8-docstrings-complete
on:When I run flake8 on this I get:
Because
flake8-docstrings-complete
is expecting something likeParameters:
instead of:A similar thing happens for the subsections since the current regex is looking for
numBlocks:
instead ofnumBlocks :
I don't expect you to actually merge my very hacky implementation below, but I figured it might give you some inspiration if you did want to implement this.
To support the numpy format I edited the section name and subsection regex's (here's a test I made for the section name regex) and altered
_get_sections
to use 2 lines at a time when checking for section headings. With these changes I now get:So clearly my subsection regex is incorrect.