From 9cb287e98d22d350fd2e6b5bd1532fde59ae12e7 Mon Sep 17 00:00:00 2001 From: Bruno Daniel Date: Sun, 10 May 2015 13:57:24 +0200 Subject: check_docs: implementation of option "accept-no-param-doc" --- pylint/extensions/check_docs.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'pylint') diff --git a/pylint/extensions/check_docs.py b/pylint/extensions/check_docs.py index 973b38f..6c29262 100644 --- a/pylint/extensions/check_docs.py +++ b/pylint/extensions/check_docs.py @@ -54,7 +54,14 @@ class ParamDocChecker(BaseChecker): 'Please add parameter type declarations for all parameters.'), } - options = () + options = (('accept-no-param-doc', + {'default': True, + 'type': 'bool', + 'help': 'Whether to accept totally missing parameter ' + 'documentation in a docstring of a function that has ' + 'parameters' + }), + ) priority = -2 @@ -204,7 +211,8 @@ class ParamDocChecker(BaseChecker): params_with_doc, params_with_type = self.match_param_docs(doc) # Tolerate no parameter documentation at all. - if not params_with_doc: + if (not params_with_doc and not params_with_type + and self.config.accept_no_param_doc): tolerate_missing_params = True compare_args(params_with_doc, 'missing-param-doc', -- cgit v1.2.1