Skip to content
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

GL01 catches valid docstring example #574

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions numpydoc/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@
# modify/remove
# start-err-msg
ERROR_MSGS = {
"GL01": "Docstring text (summary) should start in the line immediately "
"after the opening quotes (not in the same line, or leaving a "
"blank line in between)",
"GL01": "Docstring text (summary) should start right after, or on the "
"line following the opening quotes",
"GL02": "Closing quotes should be placed in the line after the last text "
"in the docstring (do not close the quotes in the same line as "
"the text, or leave a blank line between the last text and the "
Expand Down Expand Up @@ -343,6 +342,7 @@ def start_blank_lines(self):
for i, row in enumerate(self.raw_doc.split("\n")):
if row.strip():
break

return i

@property
Expand Down Expand Up @@ -645,7 +645,7 @@ def validate(obj_name, validator_cls=None, **validator_kwargs):
"examples_errors": "",
}

if doc.start_blank_lines != 1 and "\n" in doc.raw_doc:
if doc.start_blank_lines not in (0, 1) and "\n" in doc.raw_doc:
errs.append(error("GL01"))
if doc.end_blank_lines != 1 and "\n" in doc.raw_doc:
errs.append(error("GL02"))
Expand Down
Loading