Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport maintenance/3.0.x] [todos] Fix the todos version and the warnings' text #9204

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pylint/checkers/similar.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ def process_module(self, node: nodes.Module) -> None:
stream must implement the readlines method
"""
if self.linter.current_name is None:
# TODO: 3.0 Fix current_name
# TODO: 4.0 Fix current_name
warnings.warn(
(
"In pylint 3.0 the current_name attribute of the linter object should be a string. "
Expand Down
2 changes: 1 addition & 1 deletion pylint/checkers/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -2571,7 +2571,7 @@ def _loopvar_name(self, node: astroid.Name) -> None:
else_stmt, (nodes.Return, nodes.Raise, nodes.Break, nodes.Continue)
):
return
# TODO: 3.0: Consider using RefactoringChecker._is_function_def_never_returning
# TODO: 4.0: Consider using RefactoringChecker._is_function_def_never_returning
if isinstance(else_stmt, nodes.Expr) and isinstance(
else_stmt.value, nodes.Call
):
Expand Down
2 changes: 1 addition & 1 deletion pylint/config/callback_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def __call__(
values: str | Sequence[Any] | None,
option_string: str | None = "--generate-rcfile",
) -> None:
# TODO: 3.x: Deprecate this after the auto-upgrade functionality of
# TODO: 4.x: Deprecate this after the auto-upgrade functionality of
# pylint-config is sufficient.
self.run.linter._generate_config(skipsections=("Commands",))
sys.exit(0)
Expand Down
5 changes: 3 additions & 2 deletions pylint/config/config_initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,14 @@ def _config_initialization(
"unrecognized-option", args=unrecognized_options_message, line=0
)

# TODO 3.1: Change this to emit unknown-option-value
# TODO: Change this to be checked only when upgrading the configuration
for exc_name in linter.config.overgeneral_exceptions:
if "." not in exc_name:
warnings.warn_explicit(
f"'{exc_name}' is not a proper value for the 'overgeneral-exceptions' option. "
f"Use fully qualified name (maybe 'builtins.{exc_name}' ?) instead. "
"This will cease to be checked at runtime in 3.1.0.",
"This will cease to be checked at runtime when the configuration "
"upgrader is released.",
category=UserWarning,
filename="pylint: Command line or configuration file",
lineno=1,
Expand Down
2 changes: 1 addition & 1 deletion pylint/testutils/functional/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class FunctionalTestFile:
def __init__(self, directory: str, filename: str) -> None:
self._directory = directory
self.base = filename.replace(".py", "")
# TODO: 3.0: Deprecate FunctionalTestFile.options and related code
# TODO:4.0: Deprecate FunctionalTestFile.options and related code
# We should just parse these options like a normal configuration file.
self.options: TestFileOptions = {
"min_pyver": (2, 5),
Expand Down
4 changes: 2 additions & 2 deletions pylint/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def format_section(
) -> None:
"""Format an option's section using the INI format."""
warnings.warn(
"format_section has been deprecated. It will be removed in pylint 3.0.",
"format_section has been deprecated. It will be removed in pylint 4.0.",
DeprecationWarning,
stacklevel=2,
)
Expand All @@ -330,7 +330,7 @@ def format_section(
def _ini_format(stream: TextIO, options: list[tuple[str, OptionDict, Any]]) -> None:
"""Format options using the INI format."""
warnings.warn(
"_ini_format has been deprecated. It will be removed in pylint 3.0.",
"_ini_format has been deprecated. It will be removed in pylint 4.0.",
DeprecationWarning,
stacklevel=2,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_check_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def test_linter_with_unpickleable_plugins_is_pickleable(self) -> None:
linter.load_plugin_modules(["pylint.extensions.overlapping_exceptions"])
try:
dill.dumps(linter)
# TODO: 3.0: Fix this test by raising this assertion again
# TODO: 4.0: Fix this test by raising this assertion again
# raise AssertionError(
# "Plugins loaded were pickle-safe! This test needs altering"
# )
Expand Down