-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Support for Numpy, Google, and rst Docstrings #125
Comments
Yes! I'd very much like to support this but since I don't use these myself I'm not sure what is actually breaking right now. If you could provide me with some sample docstrings and what you like to see I can certainly work on this! |
@DanielNoord Thank you for your support! Thank you so much for this wonderful package! Don't get me wrong: nothing is breaking. Users must choose which format they wish to support. The VSCode autoDocstring extension is written in TypeScript, which I don't know very well so I'm not able to parse its syntax. The closest alternative I've seen of porting this to python is python-autodocstring, but it is still very much in its infancy. I believe these could be implemented using Currently, there are
This last one |
I don't really get what you mean with "porting". This package is already written in Python?
We currently use the tokens to analyse the docstrings.
Based on this last comment I wonder how you are using this package. |
I meant porting the VSCode autoDocstring extension into python, which python-autodocstring has started. I just added this here in case it was helpful to you.
That's great!
You're right, that comment was a mistake. I don't know why I put that in there. I use |
@DanielNoord In short, it would be great if and with those styles, parse signatures and determine what should be added or removed, but keep existing documentation intact (unless it is referencing a parameter that does not exist, most likely because it has been renamed or removed). |
For this you have the docparam checker in pylint |
Hmm, yeah I don't think we should be the tool to enforce docstrings on every signature. That comes with a lot of additional complexity and decision-making which I'd like to defer to tools such as That said if there is anything that makes the current tool incompatible with these styles we can certainly look into that! |
That will check the parameters, but not format them. My request is have an auto formatter. |
Those tools don't auto format thought. They can only check. My request is to have |
We could certainly format based on a |
That would be great! I think that would be plenty. |
With #132 merged and |
@DanielNoord Thank you so much for this! Couple questions:
or
or something else (comma-separated list)? (NOTE: Both the above run without error, but I'm not sure if the later syntax overwrites
Here is my - repo: https://github.com/DanielNoord/pydocstringformatter
rev: v0.7.0
hooks:
- id: pydocstringformatter
name: (pydocstringformatter) Format docstring to given style (numpy)
language: python
files: .*\.py$
args: [
"--exclude=.venv/**,stubs/**,build/**,dist/**,ci/**",
"--style numpydoc pep257",
] I then run
from the command line.
By default,
In the above cases, this may lead to a fork bomb, specifically if |
This one. We should probably add that to the documentation somewhere.
Hm, doesn't
In my own projects I haven't seen a need to do this. The tool is really quite fast, comparable or quicker than |
Would it be possible to add support for docstring styles? e.g. Numpy, Google, and rst?
The text was updated successfully, but these errors were encountered: