Method: pylint.config.arguments_manager._ArgumentsManager.cb_set_provider_option
Calls: 1, Exceptions: 0, Paths: 1Back
Path 1: 1 calls (1.0)
None (1)
'--test-opt' (1)
True (1)
None (1)
1def cb_set_provider_option( # pragma: no cover
2 self, option: Any, opt: Any, value: Any, parser: Any
3 ) -> None:
4 """DEPRECATED: Optik callback for option setting."""
5 # TODO: 3.0: Remove deprecated method.
6 warnings.warn(
7 "cb_set_provider_option has been deprecated. It will be removed in pylint 3.0.",
8 DeprecationWarning,
9 stacklevel=2,
10 )
11 if opt.startswith("--"):
12 # remove -- on long option
13 opt = opt[2:]
14 else:
15 # short option, get its long equivalent
16 opt = self._short_options[opt[1:]]
17 # trick since we can't set action='store_true' on options
18 if value is None:
19 value = 1
20 self.set_option(opt, value)