Skip to content

Commit b669112

Browse files
DOC: require returns section in validation script (pandas-dev#19994)
1 parent 024d8b4 commit b669112

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/validate_docstrings.py

+7
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ def see_also(self):
235235
def examples(self):
236236
return self.doc['Examples']
237237

238+
@property
239+
def returns(self):
240+
return self.doc['Returns']
241+
238242
@property
239243
def first_line_ends_in_dot(self):
240244
if self.doc:
@@ -436,6 +440,9 @@ def validate_one(func_name):
436440
for param_err in param_errs:
437441
errs.append('\t{}'.format(param_err))
438442

443+
if not doc.returns:
444+
errs.append('No returns section found')
445+
439446
mentioned_errs = doc.mentioned_private_classes
440447
if mentioned_errs:
441448
errs.append('Private classes ({}) should not be mentioned in public '

0 commit comments

Comments
 (0)