-
Notifications
You must be signed in to change notification settings - Fork 0
chore: enforce python docstring coverage #41
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
๐งฉ Analysis chain
๐ Web query:
What do Ruff pydocstyle rules D100-D107 cover? Do they apply only to public modules/classes/functions/methods, or also private underscore-prefixed ones?๐ก Result:
Ruffโs pydocstyle D100โD107 rules are the โmissing docstringโ checks:
__init__.py) (pydocstyle.readthedocs.io)__str__) (pydocstyle.readthedocs.io)__init__(pydocstyle.readthedocs.io)Do they apply to private (underscore-prefixed) definitions?
For D100โD104 and D106, they apply only to public constructs. In pydocstyle (which Ruff derives these from), a construct is public only if its parent is public and its name does not start with
_or__(with the special case that names like__init__.pyare treated as public for this purpose). Also, if__all__is defined, only names listed there are considered public. (pydocstyle.readthedocs.io)So, e.g.
_foo()/_Bar/_baz.pywonโt trigger D1xx โmissing docstringโ errors just because they lack docstrings. (pydocstyle.readthedocs.io)D105 is different: it targets magic methods (dunders), not โpublic vs privateโ by underscore prefix. (pydocstyle.readthedocs.io)
Citations:
D100-D107 ๊ท์น๋ง์ผ๋ก๋ "100% docstring coverage"๋ฅผ ์ค์ ๋ก ๊ฐ์ ํ์ง ๋ชปํฉ๋๋ค.
ํ์ฌ ์ ํํ Ruff ๊ท์น์ public ์ฌ๋ณผ๋ง์ ๋์์ผ๋ก ํฉ๋๋ค. ๋ฐ๋ผ์
_helper()๊ฐ์ private ํจ์๋_PrivateClass๊ฐ์ private ํด๋์ค๋ docstring ๊ฒ์ฌ ๋์์์ ์ ์ธ๋์ด ํต๊ณผํฉ๋๋ค. PR์ ๋ชฉํ์ARCHITECTURE.md์์ ๋ช ์ํ "100% docstring coverage" ์ ์ฑ ์ ์ผ์น์ํค๋ ค๋ฉด, ์ ์ฑ ๋ฌธ๊ตฌ๋ฅผ public ๋ฒ์๋ก ๋ช ํํ ์ขํ๊ฑฐ๋ private ์ฌ๋ณผ๊น์ง ํฌํจํ๋ ์ถ๊ฐ ๊ฒ์ฌ๋ฅผ ๋์ ํด์ผ ํฉ๋๋ค.