[pydocstyle] Clarify which quote styles are allowed (D300)#22825
Merged
ntBre merged 1 commit intoastral-sh:mainfrom Jan 23, 2026
Merged
[pydocstyle] Clarify which quote styles are allowed (D300)#22825ntBre merged 1 commit intoastral-sh:mainfrom
pydocstyle] Clarify which quote styles are allowed (D300)#22825ntBre merged 1 commit intoastral-sh:mainfrom
Conversation
|
ntBre
reviewed
Jan 23, 2026
Comment on lines
10
to
11
| /// Checks for docstrings that use single quotes (`'`) or triple single quotes (`'''`) | ||
| /// instead of triple double quotes (`"""`). |
Contributor
There was a problem hiding this comment.
One case not mentioned in the issue that it also looks like the rule covers is the use of non-triple double quotes:
def kos_root():
"Return the pathname of the KOS root directory."So the rule name is a bit misleading, but it essentially enforces triple double quotes. I think we could thus simplify the description to something like:
Suggested change
| /// Checks for docstrings that use single quotes (`'`) or triple single quotes (`'''`) | |
| /// instead of triple double quotes (`"""`). | |
| /// Checks for docstrings that don't use `"""triple double quotes"""`. |
ntBre
requested changes
Jan 23, 2026
Contributor
ntBre
left a comment
There was a problem hiding this comment.
Thanks! One suggestion on the phrasing and we should also not modify a generated file.
cb9f7b6 to
0632b8e
Compare
amyreese
approved these changes
Jan 23, 2026
pydocstyle] Clarify which quote styles are allowed (D300)
carljm
added a commit
that referenced
this pull request
Jan 30, 2026
* main: (62 commits) [`refurb`] Do not add `abc.ABC` if already present (`FURB180`) (#22234) [ty] Add a new `assert-type-unspellable-subtype` diagnostic (#22815) [ty] Avoid duplicate syntax errors for `await` outside functions (#22826) [ty] Fix unary operator false-positive for constrained TypeVars (#22783) [ty] Fix binary operator false-positive for constrained TypeVars (#22782) [ty] Fix false-positive `unsupported-operator` for "symmetric" TypeVars (#22756) [`pydocstyle`] Clarify which quote styles are allowed (`D300`) (#22825) [ty] Use distributed versions of AND and OR on constraint sets (#22614) [ty] Add support for dict literals and dict() calls as default values for parameters with TypedDict types (#22161) Document `-` stdin convention in CLI help text (#22817) [ty] Make `infer_subscript_expression_types` a method on `Type` (#22731) [ty] Simplify `OverloadLiteral::spans` and `OverloadLiteral::parameter_span` (#22823) [ty] Require both `*args` and `**kwargs` when calling a `ParamSpec` callable (#22820) [ty] Handle tagged errors in conformance (#22746) Add `--color` cli option to force colored output (#22806) Identify notebooks by LSP didOpen instead of `.ipynb` file extension (#22810) [ty] Fix docstring rendering for literal blocks after doctests (#22676) [ty] Update salsa to fix out-of-order query validation (#22498) [ty] Inline cycle initial and recovery functions (#22814) [ty] Pass the generic context through the decorator (#22544) ...
This was referenced Feb 9, 2026
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
This PR updates the documentation for the
D300(triple-single-quotes) rule.The description now explicitly mentions that the rule flags both single quotes (
') and triple single quotes ('''). I've also added a Python example to show the single-quote violation.Documentation was regenerated using
cargo run -p ruff_dev -- generate-docs.Fixes
Fixes #20838