Skip to content
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: sphinx #43

Closed
wwuck opened this issue Jul 11, 2023 · 6 comments
Closed

Feature request: sphinx #43

wwuck opened this issue Jul 11, 2023 · 6 comments

Comments

@wwuck
Copy link

wwuck commented Jul 11, 2023

Hi, this is a feature request to support the sphinx docstring style.

Thanks

@jsh9
Copy link
Owner

jsh9 commented Jul 11, 2023

I procrastinated a bit but this day has eventually come 😂

Yes, this is something that I could add.

Could you confirm that this is the official guide/rules of the Sphinx docstring style? https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html

Thanks!

@wwuck
Copy link
Author

wwuck commented Jul 11, 2023

@wwuck
Copy link
Author

wwuck commented Jul 11, 2023

The darglint2 readme mentions a couple of libraries that claim to parse sphinx docstring format:

https://pypi.org/project/docstring-utils/
https://pypi.org/project/docstring-parser/

@jsh9
Copy link
Owner

jsh9 commented Jul 11, 2023

Thanks!

pydoclint uses docstring-parser to parse Google-style docstrings, and I know it can also parse Sphinx-style docstrings:

docstring_parser>=0.15

The reason I'm asking for a style guide is for me to write test cases. I haven't really used the Sphinx style before.

@wwuck
Copy link
Author

wwuck commented Jul 12, 2023

I guess the link you found above looks ok for examples. I also found some bnf grammar definitions in darglint repository that may be useful: https://github.com/akaihola/darglint2/tree/master/darglint2/parse/grammars

@jsh9
Copy link
Owner

jsh9 commented Jul 16, 2023

Hi @wwuck:

I added support for the Sphinx docstring style. It's in the latest release (v0.1.0).

Please feel free to try it out. Since I'm not very familiar with this style, I don't know what different variations of this style can there be.

If you find any issues or false positives, please feel free to open other issues. Thanks!

@jsh9 jsh9 closed this as completed Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants