Method: pylint.utils.utils.get_global_option
Calls: 1, Exceptions: 0, Paths: 1Back
Path 1: 1 calls (1.0)
BaseChecker (1)
'test-opt' (1)
None (1)
True (1)
1def get_global_option(
2 checker: BaseChecker,
3 option: GLOBAL_OPTION_NAMES,
4 default: T_GlobalOptionReturnTypes | None = None, # pylint: disable=unused-argument
5) -> T_GlobalOptionReturnTypes | None | Any:
6 """DEPRECATED: Retrieve an option defined by the given *checker* or
7 by all known option providers.
8
9 It will look in the list of all options providers
10 until the given *option* will be found.
11 If the option wasn't found, the *default* value will be returned.
12 """
13 warnings.warn(
14 "get_global_option has been deprecated. You can use "
15 "checker.linter.config to get all global options instead.",
16 DeprecationWarning,
17 stacklevel=2,
18 )
19 return getattr(checker.linter.config, option.replace("-", "_"))