Method: pylint.config.arguments_manager._ArgumentsManager.set_option
Calls: 101, Exceptions: 3, Paths: 3Back
Path 1: 70 calls (0.69)
'reports' (9) 'persistent' (8) 'score' (8) 'ignore_paths' (7) 'disable' (5) 'notes' (3) 'test-opt' (3) 'output-format' (3) 'ignore-imports' (2) 'ignor...
False (26) True (8) Pattern (7) '' (4) ('os',) (2) '.*/lint/.*' (2) 'imports' (1) 'import.dot' (1) 'ext_import.dot' (1) 'int_import.dot' (1)
'default_value' (70)
'default_value' (70)
1def set_option(
2 self,
3 optname: str,
4 value: Any,
5 action: str | None = "default_value",
6 optdict: None | str | OptionDict = "default_value",
7 ) -> None:
8 """Set an option on the namespace object."""
9 # TODO: 3.0: Remove deprecated arguments.
10 if action != "default_value":
11 warnings.warn(
12 "The 'action' argument has been deprecated. You can use set_option "
13 "without the 'action' or 'optdict' arguments.",
14 DeprecationWarning,
15 stacklevel=2,
16 )
17 if optdict != "default_value":
18 warnings.warn(
19 "The 'optdict' argument has been deprecated. You can use set_option "
20 "without the 'action' or 'optdict' arguments.",
21 DeprecationWarning,
22 stacklevel=2,
23 )
24
25 self.config = self._arg_parser.parse_known_args(
26 [f"--{optname.replace('_', '-')}", _parse_rich_type_value(value)],
27 self.config,
28 )[0]
Path 2: 28 calls (0.28)
'ignore' (1) 'ignore-patterns' (1) 'ignore-paths' (1) 'persistent' (1) 'load-plugins' (1) 'output-format' (1) 'reports' (1) 'evaluation' (1) 'score' (...
False (7) () (4) [] (3) True (3) '' (2) ('CVS',) (1) tuple (1) 'text' (1) 'max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + conv...
None (23) 'store_true' (2) _OutputFormatAction def (1) _EnableAction def (1) _DisableAction def (1)
dict (12) {'default': True, 'type': 'yn', 'metavar': '
1def set_option(
2 self,
3 optname: str,
4 value: Any,
5 action: str | None = "default_value",
6 optdict: None | str | OptionDict = "default_value",
7 ) -> None:
8 """Set an option on the namespace object."""
9 # TODO: 3.0: Remove deprecated arguments.
10 if action != "default_value":
11 warnings.warn(
12 "The 'action' argument has been deprecated. You can use set_option "
13 "without the 'action' or 'optdict' arguments.",
14 DeprecationWarning,
15 stacklevel=2,
16 )
17 if optdict != "default_value":
18 warnings.warn(
19 "The 'optdict' argument has been deprecated. You can use set_option "
20 "without the 'action' or 'optdict' arguments.",
21 DeprecationWarning,
22 stacklevel=2,
23 )
24
25 self.config = self._arg_parser.parse_known_args(
26 [f"--{optname.replace('_', '-')}", _parse_rich_type_value(value)],
27 self.config,
28 )[0]
Path 3: 3 calls (0.03)
'output-format' (3)
'missing.module.Class' (1) 'lint.unittest_lint._CustomPyLinter' (1) 'lint.unittest_lint.MyReporter' (1)
'default_value' (3)
'default_value' (3)
InvalidReporterError (3)
1def set_option(
2 self,
3 optname: str,
4 value: Any,
5 action: str | None = "default_value",
6 optdict: None | str | OptionDict = "default_value",
7 ) -> None:
8 """Set an option on the namespace object."""
9 # TODO: 3.0: Remove deprecated arguments.
10 if action != "default_value":
11 warnings.warn(
12 "The 'action' argument has been deprecated. You can use set_option "
13 "without the 'action' or 'optdict' arguments.",
14 DeprecationWarning,
15 stacklevel=2,
16 )
17 if optdict != "default_value":
18 warnings.warn(
19 "The 'optdict' argument has been deprecated. You can use set_option "
20 "without the 'action' or 'optdict' arguments.",
21 DeprecationWarning,
22 stacklevel=2,
23 )
24
25 self.config = self._arg_parser.parse_known_args(
26 [f"--{optname.replace('_', '-')}", _parse_rich_type_value(value)],
27 self.config,
28 )[0]