From 889675c9ea8b3bf18cd4ba72ceaa946d1278b596 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Mon, 5 Mar 2018 15:47:37 +0100 Subject: [PATCH] DOC: require returns section in validation script --- scripts/validate_docstrings.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/validate_docstrings.py b/scripts/validate_docstrings.py index a90a55c6ce1ab..68f7d283eff8c 100755 --- a/scripts/validate_docstrings.py +++ b/scripts/validate_docstrings.py @@ -176,6 +176,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: @@ -323,6 +327,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 '