-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
fix: Parse Deprecated sections in Google-style docstrings #353
fix: Parse Deprecated sections in Google-style docstrings #353
Conversation
Looks good! Was there something else you wanted to do before getting out of draft? |
Had an IRL appointment coming up, and it was evident that if something went wrong, I'd need to return to it later in the evening (i.e., now). There's two things I still want to address:
|
👍
You can run No need to handle the other unrelated quality errors, I'll deal with them in another commit/PR 🙂 |
I've pushed a fix for the quality job, it should now pass. You can merge |
These tests currently fail, because the Deprecated sections are parsed as admonitions. Issue-352: #352
The code to parse these sections already existed, but the "Deprecated" section header was missing from the table of known section headers. Being an unknown section, Griffe then treated this as an admonition. Issue-352: #352
…ocstrings Griffe requires a version indicator in Google-style Deprecated sections. If no such indicator is found, then the user is warned, and *then* the section **is silently dropped**. [As a proponent of readable docstrings][1], [and apparently in spirit with the Google style guide][2], I consider it unacceptable to drop information from a docstring just because it is not properly formatted as data. In this patch, I propose parsing the section without an associated version number instead, and using the section's text as its... well, text. [1]: mkdocstrings/python#166 (comment) '"the source form of the docstring should be readable"' [2]: google/styleguide#117 (comment) '"Docstrings are meant for human consumption, please keep them readable for us humans. :)"' Issue-352: #352
52e0835
to
16da63e
Compare
Rebased on 1.5.5, ready for review. No formatting/linting errors. There are two failing CI checks (tests), but those both appear to be failing before the tests can even run. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a formatting suggestion, not important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, lets not warn about the missing version if we allow it to be missing.
As per @pawamoy's suggestion. PR-353: #353 Co-authored-by: Timothée Mazzucotelli <[email protected]>
2ce9669
to
60a777b
Compare
Thanks a lot! I usually squash commits and rewrite the message (if needed) when merging, so don't bother too much with commit messages 🙂 |
Thanks as well! |
Fixes #352.