summaryrefslogtreecommitdiff
path: root/pylint/extensions
diff options
context:
space:
mode:
authorSushobhit <31987769+sushobhit27@users.noreply.github.com>2018-05-19 14:19:12 +0530
committerClaudiu Popa <pcmanticore@gmail.com>2018-05-19 10:49:12 +0200
commit0120e4b671bcb8e81500de787a284b38af282bac (patch)
tree20ecfbe5b28db1e1ffaccf2b15146fe2e8b08a44 /pylint/extensions
parentc21c731451e09c68f29d670bd286b23638269116 (diff)
downloadpylint-git-0120e4b671bcb8e81500de787a284b38af282bac.tar.gz
Take annotations in account for missing-type-doc and missing-return-doc
Close #2083
Diffstat (limited to 'pylint/extensions')
-rw-r--r--pylint/extensions/docparams.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/pylint/extensions/docparams.py b/pylint/extensions/docparams.py
index 9533d191d..a73677486 100644
--- a/pylint/extensions/docparams.py
+++ b/pylint/extensions/docparams.py
@@ -237,6 +237,9 @@ class DocstringParameterChecker(BaseChecker):
node=func_node
)
+ if func_node.returns:
+ return
+
if not (doc.has_rtype() or
(doc.has_property_type() and is_property)):
self.add_message(
@@ -388,6 +391,11 @@ class DocstringParameterChecker(BaseChecker):
_compare_missing_args(params_with_doc, 'missing-param-doc',
self.not_needed_param_in_docstring)
+
+ for index, arg_name in enumerate(arguments_node.args):
+ if arguments_node.annotations[index]:
+ params_with_type.add(arg_name.name)
+
_compare_missing_args(params_with_type, 'missing-type-doc',
not_needed_type_in_docstring)