summaryrefslogtreecommitdiff
path: root/pylint/utils
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2023-03-09 11:51:17 +0100
committerGitHub <noreply@github.com>2023-03-09 11:51:17 +0100
commitb2ab82a1daed9a9cc2062272e15dee7e6648e6b6 (patch)
treeab934b750020be616d4a1ed90084ce751cedd86b /pylint/utils
parent0db9441a6f6675bfe1a82d6770a8cef72a7f0d22 (diff)
downloadpylint-git-b2ab82a1daed9a9cc2062272e15dee7e6648e6b6.tar.gz
Remove deprecated functions and classes (#8409)
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Diffstat (limited to 'pylint/utils')
-rw-r--r--pylint/utils/__init__.py2
-rw-r--r--pylint/utils/utils.py84
2 files changed, 1 insertions, 85 deletions
diff --git a/pylint/utils/__init__.py b/pylint/utils/__init__.py
index bc5011db9..ccf4079c4 100644
--- a/pylint/utils/__init__.py
+++ b/pylint/utils/__init__.py
@@ -20,7 +20,6 @@ from pylint.utils.utils import (
decoding_stream,
diff_string,
format_section,
- get_global_option,
get_module_and_frameid,
get_rst_section,
get_rst_title,
@@ -41,7 +40,6 @@ __all__ = [
"diff_string",
"FileState",
"format_section",
- "get_global_option",
"get_module_and_frameid",
"get_rst_section",
"get_rst_title",
diff --git a/pylint/utils/utils.py b/pylint/utils/utils.py
index 054d307bc..2bdc529cc 100644
--- a/pylint/utils/utils.py
+++ b/pylint/utils/utils.py
@@ -24,17 +24,7 @@ import tokenize
import warnings
from collections.abc import Sequence
from io import BufferedReader, BytesIO
-from typing import (
- TYPE_CHECKING,
- Any,
- List,
- Pattern,
- TextIO,
- Tuple,
- TypeVar,
- Union,
- overload,
-)
+from typing import TYPE_CHECKING, Any, List, Pattern, TextIO, Tuple, TypeVar, Union
from astroid import Module, modutils, nodes
@@ -47,7 +37,6 @@ else:
from typing_extensions import Literal
if TYPE_CHECKING:
- from pylint.checkers.base_checker import BaseChecker
from pylint.lint import PyLinter
DEFAULT_LINE_LENGTH = 79
@@ -215,77 +204,6 @@ def register_plugins(linter: PyLinter, directory: str) -> None:
imported[base] = 1
-@overload
-def get_global_option(
- checker: BaseChecker, option: GLOBAL_OPTION_BOOL, default: bool | None = ...
-) -> bool:
- ...
-
-
-@overload
-def get_global_option(
- checker: BaseChecker, option: GLOBAL_OPTION_INT, default: int | None = ...
-) -> int:
- ...
-
-
-@overload
-def get_global_option(
- checker: BaseChecker,
- option: GLOBAL_OPTION_LIST,
- default: list[str] | None = ...,
-) -> list[str]:
- ...
-
-
-@overload
-def get_global_option(
- checker: BaseChecker,
- option: GLOBAL_OPTION_PATTERN,
- default: Pattern[str] | None = ...,
-) -> Pattern[str]:
- ...
-
-
-@overload
-def get_global_option(
- checker: BaseChecker,
- option: GLOBAL_OPTION_PATTERN_LIST,
- default: list[Pattern[str]] | None = ...,
-) -> list[Pattern[str]]:
- ...
-
-
-@overload
-def get_global_option(
- checker: BaseChecker,
- option: GLOBAL_OPTION_TUPLE_INT,
- default: tuple[int, ...] | None = ...,
-) -> tuple[int, ...]:
- ...
-
-
-def get_global_option(
- checker: BaseChecker,
- option: GLOBAL_OPTION_NAMES,
- default: T_GlobalOptionReturnTypes | None = None, # pylint: disable=unused-argument
-) -> T_GlobalOptionReturnTypes | None | Any:
- """DEPRECATED: Retrieve an option defined by the given *checker* or
- by all known option providers.
-
- It will look in the list of all options providers
- until the given *option* will be found.
- If the option wasn't found, the *default* value will be returned.
- """
- warnings.warn(
- "get_global_option has been deprecated. You can use "
- "checker.linter.config to get all global options instead.",
- DeprecationWarning,
- stacklevel=2,
- )
- return getattr(checker.linter.config, option.replace("-", "_"))
-
-
def _splitstrip(string: str, sep: str = ",") -> list[str]:
"""Return a list of stripped string by splitting the string given as
argument on `sep` (',' by default), empty strings are discarded.