fix: Parse Deprecated sections in Google-style docstrings#353
fix: Parse Deprecated sections in Google-style docstrings#353pawamoy merged 5 commits intomkdocstrings:mainfrom the-13th-letter:google-section-deprecated
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
|
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. |
pawamoy
left a comment
There was a problem hiding this comment.
LGTM, just a formatting suggestion, not important.
pawamoy
left a comment
There was a problem hiding this comment.
Actually, lets not warn about the missing version if we allow it to be missing.
|
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.