-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[pydoclint
] Consider DOC201
satisfied if docstring begins with "Returns"
#12675
Conversation
|
Should this only be applied to single-line docstrings? |
The google document is not specific. I leave it up to you. |
Also I guess this should also apply to yield. I'll add that. |
crates/ruff_linter/src/rules/pydoclint/rules/check_docstring.rs
Outdated
Show resolved
Hide resolved
I think technically
implies that there may be more than one sentence. |
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.
I added test cases for multiline docstring for both "Returns" and "Yields".
…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 <[email protected]>
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.