diff --git a/scripts/validate_docstrings.py b/scripts/validate_docstrings.py index ce3814a1314c16..8425882f07be1a 100755 --- a/scripts/validate_docstrings.py +++ b/scripts/validate_docstrings.py @@ -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: @@ -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 '