Skip to content

Commit

Permalink
Disable fixme for internal uses before we make it optional in #3512
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed May 1, 2022
1 parent e1769bd commit 200e1a1
Show file tree
Hide file tree
Showing 19 changed files with 17 additions and 31 deletions.
2 changes: 1 addition & 1 deletion pylint/checkers/base_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def create_message_definition_from_tuple(
warnings.filterwarnings("ignore", category=DeprecationWarning)
if isinstance(self, (BaseTokenChecker, BaseRawFileChecker)):
default_scope = WarningScope.LINE
# TODO: 3.0: Remove deprecated if-statement # pylint: disable=fixme
# TODO: 3.0: Remove deprecated if-statement
elif implements(self, (IRawChecker, ITokenChecker)):
warnings.warn( # pragma: no cover
"Checkers should subclass BaseTokenChecker or BaseRawFileChecker"
Expand Down
1 change: 0 additions & 1 deletion pylint/checkers/classes/special_methods_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ def _is_iterator(node):
if isinstance(node, astroid.bases.Generator):
# Generators can be iterated.
return True
# pylint: disable-next=fixme
# TODO: 2.14: Should be covered by https://github.com/PyCQA/astroid/pull/1475
if isinstance(node, nodes.ComprehensionScope):
# Comprehensions can be iterated.
Expand Down
3 changes: 0 additions & 3 deletions pylint/checkers/typecheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,6 @@ def _emit_no_member(
def _determine_callable(
callable_obj: nodes.NodeNG,
) -> tuple[CallableObjects, int, str]:
# pylint: disable=fixme
# TODO: The typing of the second return variable is actually Literal[0,1]
# We need typing on astroid.NodeNG.implicit_parameters for this
# TODO: The typing of the third return variable can be narrowed to a Literal
Expand Down Expand Up @@ -1828,7 +1827,6 @@ def _check_unsupported_alternative_union_syntax(self, node: nodes.BinOp) -> None
self.add_message("unsupported-binary-operation", args=msg, node=node)
break

# pylint: disable-next=fixme
# TODO: This check was disabled (by adding the leading underscore)
# due to false positives several years ago - can we re-enable it?
# https://github.com/PyCQA/pylint/issues/6359
Expand All @@ -1837,7 +1835,6 @@ def _visit_binop(self, node: nodes.BinOp) -> None:
"""Detect TypeErrors for binary arithmetic operands."""
self._check_binop_errors(node)

# pylint: disable-next=fixme
# TODO: This check was disabled (by adding the leading underscore)
# due to false positives several years ago - can we re-enable it?
# https://github.com/PyCQA/pylint/issues/6359
Expand Down
1 change: 0 additions & 1 deletion pylint/checkers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,6 @@ def _supports_protocol(
if protocol_callback(value):
return True

# pylint: disable-next=fixme
# TODO: 2.14: Should be covered by https://github.com/PyCQA/astroid/pull/1475
if isinstance(value, nodes.ComprehensionScope):
return True
Expand Down
1 change: 0 additions & 1 deletion pylint/checkers/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -2200,7 +2200,6 @@ def _loopvar_name(self, node: astroid.Name) -> None:
scope = node.scope()
# FunctionDef subclasses Lambda due to a curious ontology. Check both.
# See https://github.com/PyCQA/astroid/issues/291
# pylint: disable-next=fixme
# TODO: Revisit when astroid 3.0 includes the change
if isinstance(scope, nodes.Lambda) and any(
asmt.scope().parent_of(scope) for asmt in astmts
Expand Down
10 changes: 5 additions & 5 deletions pylint/config/arguments_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class UnsupportedAction(Exception):
"""Raised by set_option when it doesn't know what to do for an action."""

def __init__(self, *args: object) -> None:
# TODO: 3.0: Remove deprecated exception # pylint: disable=fixme
# TODO: 3.0: Remove deprecated exception
warnings.warn(
"UnsupportedAction has been deprecated and will be removed in pylint 3.0",
DeprecationWarning,
Expand Down Expand Up @@ -50,7 +50,7 @@ def __init__(self, arguments_manager: _ArgumentsManager) -> None:

@property
def level(self) -> int:
# TODO: 3.0: Remove deprecated attribute # pylint: disable=fixme
# TODO: 3.0: Remove deprecated attribute
warnings.warn(
"The level attribute has been deprecated. It was used to display the checker in the help or not,"
" and everything is displayed in the help now. It will be removed in pylint 3.0.",
Expand All @@ -60,7 +60,7 @@ def level(self) -> int:

@level.setter
def level(self, value: int) -> None:
# TODO: 3.0: Remove deprecated attribute # pylint: disable=fixme
# TODO: 3.0: Remove deprecated attribute
warnings.warn(
"Setting the level attribute has been deprecated. It was used to display the checker in the help or not,"
" and everything is displayed in the help now. It will be removed in pylint 3.0.",
Expand All @@ -70,7 +70,7 @@ def level(self, value: int) -> None:

@property
def config(self) -> argparse.Namespace:
# TODO: 3.0: Remove deprecated attribute # pylint: disable=fixme
# TODO: 3.0: Remove deprecated attribute
warnings.warn(
"The checker-specific config attribute has been deprecated. Please use "
"'linter.config' to access the global configuration object.",
Expand Down Expand Up @@ -124,7 +124,7 @@ def option_value(self, opt: str) -> Any: # pragma: no cover
# pylint: disable-next=unused-argument
def set_option(self, optname, value, action=None, optdict=None): # pragma: no cover
"""DEPRECATED: Method called to set an option (registered in the options list)."""
# TODO: 3.0: Remove deprecated method. # pylint: disable=fixme
# TODO: 3.0: Remove deprecated method.
warnings.warn(
"set_option has been deprecated. You can use _arguments_manager.set_option "
"or linter.set_option to set options on the global configuration object.",
Expand Down
1 change: 0 additions & 1 deletion pylint/config/callback_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ def __call__(
values: str | Sequence[Any] | None,
option_string: str | None = "--generate-rcfile",
) -> None:
# pylint: disable-next=fixme
# TODO: 2.14: Deprecate this after discussion about this removal has been completed.
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
Expand Down
1 change: 0 additions & 1 deletion pylint/config/find_default_config_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def find_default_config_files() -> Iterator[Path]:

def find_pylintrc() -> str | None:
"""Search the pylint rc file and return its path if it finds it, else return None."""
# pylint: disable-next=fixme
# TODO: 3.0: Remove deprecated function
warnings.warn(
"find_pylintrc and the PYLINTRC constant have been deprecated. "
Expand Down
2 changes: 1 addition & 1 deletion pylint/config/option.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class Option(optparse.Option):
TYPE_CHECKER["py_version"] = _py_version_validator

def __init__(self, *opts, **attrs):
# TODO: 3.0: Remove deprecated class # pylint: disable=fixme
# TODO: 3.0: Remove deprecated class
warnings.warn(
"Option has been deprecated and will be removed in pylint 3.0",
DeprecationWarning,
Expand Down
2 changes: 1 addition & 1 deletion pylint/config/option_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def _level_options(group, outputlevel):

class OptionParser(optparse.OptionParser):
def __init__(self, option_class, *args, **kwargs):
# TODO: 3.0: Remove deprecated class # pylint: disable=fixme
# TODO: 3.0: Remove deprecated class
warnings.warn(
"OptionParser has been deprecated and will be removed in pylint 3.0",
DeprecationWarning,
Expand Down
2 changes: 1 addition & 1 deletion pylint/config/options_provider_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class OptionsProviderMixIn:
level = 0

def __init__(self):
# TODO: 3.0: Remove deprecated class # pylint: disable=fixme
# TODO: 3.0: Remove deprecated class
warnings.warn(
"OptionsProviderMixIn has been deprecated and will be removed in pylint 3.0",
DeprecationWarning,
Expand Down
1 change: 0 additions & 1 deletion pylint/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
MAIN_CHECKER_NAME = "master"

USER_HOME = os.path.expanduser("~")
# pylint: disable-next=fixme
# TODO: 3.0: Remove in 3.0 with all the surrounding code
OLD_DEFAULT_PYLINT_HOME = ".pylint.d"
DEFAULT_PYLINT_HOME = platformdirs.user_cache_dir("pylint")
Expand Down
2 changes: 1 addition & 1 deletion pylint/lint/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _worker_check_single_file(
file_item: FileItem,
) -> tuple[
int,
# TODO: 3.0: Make this only str after deprecation has been removed # pylint: disable=fixme
# TODO: 3.0: Make this only str after deprecation has been removed
str | None,
str,
str | None,
Expand Down
12 changes: 5 additions & 7 deletions pylint/lint/pylinter.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ def __init__(
options: Options = (),
reporter: reporters.BaseReporter | reporters.MultiReporter | None = None,
option_groups: tuple[tuple[str, str], ...] = (),
# pylint: disable-next=fixme
# TODO: Deprecate passing the pylintrc parameter
pylintrc: str | None = None, # pylint: disable=unused-argument
) -> None:
Expand Down Expand Up @@ -314,7 +313,7 @@ def __init__(

@property
def option_groups(self) -> tuple[tuple[str, str], ...]:
# TODO: 3.0: Remove deprecated attribute # pylint: disable=fixme
# TODO: 3.0: Remove deprecated attribute
warnings.warn(
"The option_groups attribute has been deprecated and will be removed in pylint 3.0",
DeprecationWarning,
Expand Down Expand Up @@ -706,7 +705,6 @@ def check(self, files_or_modules: Sequence[str] | str) -> None:
"""
self.initialize()
if not isinstance(files_or_modules, (list, tuple)):
# pylint: disable-next=fixme
# TODO: 3.0: Remove deprecated typing and update docstring
warnings.warn(
"In pylint 3.0, the checkers check function will only accept sequence of string",
Expand Down Expand Up @@ -871,7 +869,7 @@ def set_current_module(
return
self.reporter.on_set_current_module(modname or "", filepath)
if modname is None:
# TODO: 3.0: Remove all modname or ""'s in this method # pylint: disable=fixme
# TODO: 3.0: Remove all modname or ""'s in this method
warnings.warn(
(
"In pylint 3.0 modname should be a string so that it can be used to "
Expand Down Expand Up @@ -899,7 +897,7 @@ def _astroid_module_checker(
for c in _checkers
if isinstance(c, checkers.BaseTokenChecker) and c is not self
]
# TODO: 3.0: Remove deprecated for-loop # pylint: disable=fixme
# TODO: 3.0: Remove deprecated for-loop
for c in _checkers:
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
Expand All @@ -918,7 +916,7 @@ def _astroid_module_checker(
rawcheckers = [
c for c in _checkers if isinstance(c, checkers.BaseRawFileChecker)
]
# TODO: 3.0: Remove deprecated if-statement # pylint: disable=fixme
# TODO: 3.0: Remove deprecated if-statement
for c in _checkers:
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
Expand Down Expand Up @@ -1006,7 +1004,7 @@ def check_astroid_module(
ast_node, walker, rawcheckers, tokencheckers
)

# TODO: 3.0: Remove unnecessary assertion # pylint: disable=fixme
# TODO: 3.0: Remove unnecessary assertion
assert self.current_name

self.stats.by_module[self.current_name]["statement"] = (
Expand Down
1 change: 0 additions & 1 deletion pylint/reporters/base_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def handle_message(self, msg: Message) -> None:

def set_output(self, output: TextIO | None = None) -> None:
"""Set output stream."""
# pylint: disable-next=fixme
# TODO: 3.0: Remove deprecated method
warn(
"'set_output' will be removed in 3.0, please use 'reporter.out = stream' instead",
Expand Down
2 changes: 0 additions & 2 deletions pylint/testutils/checker_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
class CheckerTestCase:
"""A base testcase class for unit testing individual checker classes."""

# pylint: disable-next=fixme
# TODO: Figure out way to type this as type[BaseChecker] while also
# setting self.checker correctly.
CHECKER_CLASS: Any
Expand Down Expand Up @@ -79,7 +78,6 @@ def assertAddsMessages(
assert expected_msg.line == gotten_msg.line, msg
assert expected_msg.col_offset == gotten_msg.col_offset, msg
if PY38_PLUS:
# pylint: disable=fixme
# TODO: 3.0: Remove deprecated missing arguments and remove the warning
if not expected_msg.end_line == gotten_msg.end_line:
warnings.warn( # pragma: no cover
Expand Down
1 change: 0 additions & 1 deletion pylint/testutils/unittest_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def add_message(
self,
msgid: str,
line: int | None = None,
# pylint: disable=fixme
# TODO: Make node non optional
node: nodes.NodeNG | None = None,
args: Any = None,
Expand Down
2 changes: 2 additions & 0 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ disable=
too-few-public-methods,
# handled by black
format,
# We anticipate #3512 where it will become optional
fixme,


[REPORTS]
Expand Down
1 change: 0 additions & 1 deletion tests/test_self.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ def test_parallel_execution(self) -> None:
def test_parallel_execution_missing_arguments(self) -> None:
self._runtest(["-j 2", "not_here", "not_here_too"], code=1)

# pylint: disable-next=fixme
# TODO: PY3.7: Turn off abbreviations in ArgumentsManager after 3.7 support has been dropped
# argparse changed behaviour with abbreviations on/off in 3.8+ so we can't
@pytest.mark.xfail
Expand Down

0 comments on commit 200e1a1

Please sign in to comment.