Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
quotation mark at start or end of docstring #166
The new D403 (#165) triggers an error when an extra quotation mark is in the docstring, such as
If the docstring has an extra quotation mark at the end (
The following does not generate a pep257 error:
I think it would be useful to have a separate error code for either of those, as they are a specific case that is more of an error than a style issue, and there is less chance that the new code would be included in an ignore list.
I've found (and fixed) these quad-quotes in many projects that have large development teams and quality code review, even in cpython. And I am guilty of adding one. They slip through because they are hard to spot, by the coder and by reviewers; over-quotation-blindness or something.
fwiw, there is also a pep8 PR which will catch these, but again it is an indirect error rather than a specific check.
So something strange:
When I have a test file with the following content,
I get the following errors:
This is inconsistent with what @jayvdb mentioned above. Am I missing something?
@varunagrawal , your results are not inconsistent, but rather you have shown one way that is possible to trigger other rules to return errors.
Specifically, only line 4 in your example is returning errors, whereas the docstring for