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

DOC: require returns section in validation script #19994

Merged
Merged
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
7 changes: 7 additions & 0 deletions scripts/validate_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ def see_also(self):
def examples(self):
return self.doc['Examples']

@property
def returns(self):
return self.doc['Returns']

@property
def first_line_ends_in_dot(self):
if self.doc:
Expand Down Expand Up @@ -436,6 +440,9 @@ def validate_one(func_name):
for param_err in param_errs:
errs.append('\t{}'.format(param_err))

if not doc.returns:
errs.append('No returns section found')

mentioned_errs = doc.mentioned_private_classes
if mentioned_errs:
errs.append('Private classes ({}) should not be mentioned in public '
Expand Down