Method: pylint.extensions.docparams.DocstringParameterChecker._compare_ignored_args
Calls: 558, Exceptions: 0, Paths: 2Back
Path 1: 548 calls (0.98)
set() (349) {'named_arg'} (48) {'doc_type'} (20) {'y'} (12) {'arg'} (12) {'yarg1'} (6) {'yarg'} (6) {'z'} (5) {'zarg', 'warg', 'yarg', 'xarg'} (5) {'x...
'useless-type-doc' (274) 'useless-param-doc' (274)
set() (534) {'_'} (6) {'_some_private_param'} (4) {'_new'} (4)
FunctionDef (520) ClassDef (20) AsyncFunctionDef (8)
1def _compare_ignored_args( # pylint: disable=useless-param-doc
2 self,
3 found_argument_names: set[str],
4 message_id: str,
5 ignored_argument_names: set[str],
6 warning_node: nodes.NodeNG,
7 ) -> None:
8 """Compare the found argument names with the ignored ones and
9 generate a message if there are ignored arguments found.
10
11 :param found_argument_names: argument names found in the docstring
12 :param message_id: pylint message id
13 :param ignored_argument_names: Expected argument names
14 :param warning_node: The node to be analyzed
15 """
16 existing_ignored_argument_names = ignored_argument_names & found_argument_names
17
18 if existing_ignored_argument_names:
19 self.add_message(
20 message_id,
21 args=(", ".join(sorted(existing_ignored_argument_names)),),
22 node=warning_node,
23 confidence=HIGH,
24 )
Path 2: 10 calls (0.02)
{'_', 'arg'} (3) {'_', '_ignored', 'arg'} (3) {'_new'} (2) {'_some_private_param'} (1) {'_some_private_param', 'public_param'} (1)
'useless-type-doc' (5) 'useless-param-doc' (5)
{'_', '_ignored'} (6) {'_some_private_param'} (2) {'_new'} (2)
FunctionDef (10)
1def _compare_ignored_args( # pylint: disable=useless-param-doc
2 self,
3 found_argument_names: set[str],
4 message_id: str,
5 ignored_argument_names: set[str],
6 warning_node: nodes.NodeNG,
7 ) -> None:
8 """Compare the found argument names with the ignored ones and
9 generate a message if there are ignored arguments found.
10
11 :param found_argument_names: argument names found in the docstring
12 :param message_id: pylint message id
13 :param ignored_argument_names: Expected argument names
14 :param warning_node: The node to be analyzed
15 """
16 existing_ignored_argument_names = ignored_argument_names & found_argument_names
17
18 if existing_ignored_argument_names:
19 self.add_message(
20 message_id,
21 args=(", ".join(sorted(existing_ignored_argument_names)),),
22 node=warning_node,
23 confidence=HIGH,
24 )