[pydoclint] Consider DOC201 satisfied if docstring begins with "Returns"#12675
Merged
dhruvmanila merged 5 commits intoastral-sh:mainfrom Aug 6, 2024
Merged
[pydoclint] Consider DOC201 satisfied if docstring begins with "Returns"#12675dhruvmanila merged 5 commits intoastral-sh:mainfrom
pydoclint] Consider DOC201 satisfied if docstring begins with "Returns"#12675dhruvmanila merged 5 commits intoastral-sh:mainfrom
Conversation
Contributor
|
Member
|
Should this only be applied to single-line docstrings? |
Contributor
Author
|
The google document is not specific. I leave it up to you. |
Contributor
Author
|
Also I guess this should also apply to yield. I'll add that. |
dhruvmanila
reviewed
Aug 5, 2024
Contributor
Author
|
I think technically
implies that there may be more than one sentence. |
dhruvmanila
reviewed
Aug 6, 2024
dhruvmanila
approved these changes
Aug 6, 2024
Member
dhruvmanila
left a comment
There was a problem hiding this comment.
I added test cases for multiline docstring for both "Returns" and "Yields".
dylwil3
pushed a commit
to dylwil3/ruff
that referenced
this pull request
Aug 7, 2024
…eturns" (astral-sh#12675) <!-- Thank you for contributing to Ruff! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary Resolves astral-sh#12636 Consider docstrings which begin with the word "Returns" as having satisfactorily documented they're returns. For example ```python def f(): """Returns 1.""" return 1 ``` is valid. ## Test Plan Added example to test fixture. --------- Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Resolves #12636
Consider docstrings which begin with the word "Returns" as having satisfactorily documented they're returns. For example
is valid.
Test Plan
Added example to test fixture.