Skip to content

Commit 76b8538

Browse files
Disable fixme for internal uses before we make it optional in #3512 (#6482)
1 parent e1769bd commit 76b8538

26 files changed

+25
-43
lines changed

pylint/checkers/base_checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def create_message_definition_from_tuple(
189189
warnings.filterwarnings("ignore", category=DeprecationWarning)
190190
if isinstance(self, (BaseTokenChecker, BaseRawFileChecker)):
191191
default_scope = WarningScope.LINE
192-
# TODO: 3.0: Remove deprecated if-statement # pylint: disable=fixme
192+
# TODO: 3.0: Remove deprecated if-statement
193193
elif implements(self, (IRawChecker, ITokenChecker)):
194194
warnings.warn( # pragma: no cover
195195
"Checkers should subclass BaseTokenChecker or BaseRawFileChecker"

pylint/checkers/classes/special_methods_checker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ def _is_iterator(node):
288288
if isinstance(node, astroid.bases.Generator):
289289
# Generators can be iterated.
290290
return True
291-
# pylint: disable-next=fixme
292291
# TODO: 2.14: Should be covered by https://github.com/PyCQA/astroid/pull/1475
293292
if isinstance(node, nodes.ComprehensionScope):
294293
# Comprehensions can be iterated.

pylint/checkers/typecheck.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,6 @@ def _emit_no_member(
526526
def _determine_callable(
527527
callable_obj: nodes.NodeNG,
528528
) -> tuple[CallableObjects, int, str]:
529-
# pylint: disable=fixme
530529
# TODO: The typing of the second return variable is actually Literal[0,1]
531530
# We need typing on astroid.NodeNG.implicit_parameters for this
532531
# TODO: The typing of the third return variable can be narrowed to a Literal
@@ -1828,7 +1827,6 @@ def _check_unsupported_alternative_union_syntax(self, node: nodes.BinOp) -> None
18281827
self.add_message("unsupported-binary-operation", args=msg, node=node)
18291828
break
18301829

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

1840-
# pylint: disable-next=fixme
18411838
# TODO: This check was disabled (by adding the leading underscore)
18421839
# due to false positives several years ago - can we re-enable it?
18431840
# https://github.com/PyCQA/pylint/issues/6359

pylint/checkers/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,6 @@ def _supports_protocol(
11661166
if protocol_callback(value):
11671167
return True
11681168

1169-
# pylint: disable-next=fixme
11701169
# TODO: 2.14: Should be covered by https://github.com/PyCQA/astroid/pull/1475
11711170
if isinstance(value, nodes.ComprehensionScope):
11721171
return True

pylint/checkers/variables.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2200,7 +2200,6 @@ def _loopvar_name(self, node: astroid.Name) -> None:
22002200
scope = node.scope()
22012201
# FunctionDef subclasses Lambda due to a curious ontology. Check both.
22022202
# See https://github.com/PyCQA/astroid/issues/291
2203-
# pylint: disable-next=fixme
22042203
# TODO: Revisit when astroid 3.0 includes the change
22052204
if isinstance(scope, nodes.Lambda) and any(
22062205
asmt.scope().parent_of(scope) for asmt in astmts

pylint/config/arguments_manager.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ def __init__(
8080
self._option_dicts: dict[str, OptionDict] = {}
8181
"""All option dictionaries that have been registered."""
8282

83-
# pylint: disable=fixme
8483
# TODO: 3.0: Remove deprecated attributes introduced to keep API
8584
# parity with optparse. Until '_maxlevel'
8685
with warnings.catch_warnings():
@@ -107,7 +106,7 @@ def config(self, value: argparse.Namespace) -> None:
107106

108107
@property
109108
def options_providers(self) -> list[ConfigProvider]:
110-
# TODO: 3.0: Remove deprecated attribute. # pylint: disable=fixme
109+
# TODO: 3.0: Remove deprecated attribute.
111110
warnings.warn(
112111
"options_providers has been deprecated. It will be removed in pylint 3.0.",
113112
DeprecationWarning,
@@ -629,7 +628,7 @@ def help(self, level: int | None = None) -> str:
629628

630629
def cb_set_provider_option(self, option, opt, value, parser): # pragma: no cover
631630
"""DEPRECATED: Optik callback for option setting."""
632-
# TODO: 3.0: Remove deprecated method. # pylint: disable=fixme
631+
# TODO: 3.0: Remove deprecated method.
633632
warnings.warn(
634633
"cb_set_provider_option has been deprecated. It will be removed in pylint 3.0.",
635634
DeprecationWarning,
@@ -647,7 +646,7 @@ def cb_set_provider_option(self, option, opt, value, parser): # pragma: no cove
647646

648647
def global_set_option(self, opt: str, value: Any) -> None: # pragma: no cover
649648
"""DEPRECATED: Set option on the correct option provider."""
650-
# TODO: 3.0: Remove deprecated method. # pylint: disable=fixme
649+
# TODO: 3.0: Remove deprecated method.
651650
warnings.warn(
652651
"global_set_option has been deprecated. You can use _arguments_manager.set_option "
653652
"or linter.set_option to set options on the global configuration object.",
@@ -734,7 +733,7 @@ def set_option(
734733
optdict: None | str | OptionDict = "default_value",
735734
) -> None:
736735
"""Set an option on the namespace object."""
737-
# TODO: 3.0: Remove deprecated arguments. # pylint: disable=fixme
736+
# TODO: 3.0: Remove deprecated arguments.
738737
if action != "default_value":
739738
warnings.warn(
740739
"The 'action' argument has been deprecated. You can use set_option "

pylint/config/arguments_provider.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class UnsupportedAction(Exception):
2020
"""Raised by set_option when it doesn't know what to do for an action."""
2121

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

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

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

7171
@property
7272
def config(self) -> argparse.Namespace:
73-
# TODO: 3.0: Remove deprecated attribute # pylint: disable=fixme
73+
# TODO: 3.0: Remove deprecated attribute
7474
warnings.warn(
7575
"The checker-specific config attribute has been deprecated. Please use "
7676
"'linter.config' to access the global configuration object.",
@@ -124,7 +124,7 @@ def option_value(self, opt: str) -> Any: # pragma: no cover
124124
# pylint: disable-next=unused-argument
125125
def set_option(self, optname, value, action=None, optdict=None): # pragma: no cover
126126
"""DEPRECATED: Method called to set an option (registered in the options list)."""
127-
# TODO: 3.0: Remove deprecated method. # pylint: disable=fixme
127+
# TODO: 3.0: Remove deprecated method.
128128
warnings.warn(
129129
"set_option has been deprecated. You can use _arguments_manager.set_option "
130130
"or linter.set_option to set options on the global configuration object.",

pylint/config/callback_actions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ def __call__(
261261
values: str | Sequence[Any] | None,
262262
option_string: str | None = "--generate-rcfile",
263263
) -> None:
264-
# pylint: disable-next=fixme
265264
# TODO: 2.14: Deprecate this after discussion about this removal has been completed.
266265
with warnings.catch_warnings():
267266
warnings.filterwarnings("ignore", category=DeprecationWarning)

pylint/config/configuration_mixin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ConfigurationMixIn(OptionsManagerMixIn, OptionsProviderMixIn):
1414
"""
1515

1616
def __init__(self, *args, **kwargs):
17-
# TODO: 3.0: Remove deprecated class # pylint: disable=fixme
17+
# TODO: 3.0: Remove deprecated class
1818
warnings.warn(
1919
"ConfigurationMixIn has been deprecated and will be removed in pylint 3.0",
2020
DeprecationWarning,

pylint/config/find_default_config_files.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ def find_default_config_files() -> Iterator[Path]:
7878

7979
def find_pylintrc() -> str | None:
8080
"""Search the pylint rc file and return its path if it finds it, else return None."""
81-
# pylint: disable-next=fixme
8281
# TODO: 3.0: Remove deprecated function
8382
warnings.warn(
8483
"find_pylintrc and the PYLINTRC constant have been deprecated. "

pylint/config/option.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class Option(optparse.Option):
172172
TYPE_CHECKER["py_version"] = _py_version_validator
173173

174174
def __init__(self, *opts, **attrs):
175-
# TODO: 3.0: Remove deprecated class # pylint: disable=fixme
175+
# TODO: 3.0: Remove deprecated class
176176
warnings.warn(
177177
"Option has been deprecated and will be removed in pylint 3.0",
178178
DeprecationWarning,

pylint/config/option_manager_mixin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class OptionsManagerMixIn:
6464
"""Handle configuration from both a configuration file and command line options."""
6565

6666
def __init__(self, usage):
67-
# TODO: 3.0: Remove deprecated class # pylint: disable=fixme
67+
# TODO: 3.0: Remove deprecated class
6868
warnings.warn(
6969
"OptionsManagerMixIn has been deprecated and will be removed in pylint 3.0",
7070
DeprecationWarning,

pylint/config/option_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def _level_options(group, outputlevel):
1919

2020
class OptionParser(optparse.OptionParser):
2121
def __init__(self, option_class, *args, **kwargs):
22-
# TODO: 3.0: Remove deprecated class # pylint: disable=fixme
22+
# TODO: 3.0: Remove deprecated class
2323
warnings.warn(
2424
"OptionParser has been deprecated and will be removed in pylint 3.0",
2525
DeprecationWarning,

pylint/config/options_provider_mixin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class OptionsProviderMixIn:
2323
level = 0
2424

2525
def __init__(self):
26-
# TODO: 3.0: Remove deprecated class # pylint: disable=fixme
26+
# TODO: 3.0: Remove deprecated class
2727
warnings.warn(
2828
"OptionsProviderMixIn has been deprecated and will be removed in pylint 3.0",
2929
DeprecationWarning,

pylint/constants.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
MAIN_CHECKER_NAME = "master"
4949

5050
USER_HOME = os.path.expanduser("~")
51-
# pylint: disable-next=fixme
5251
# TODO: 3.0: Remove in 3.0 with all the surrounding code
5352
OLD_DEFAULT_PYLINT_HOME = ".pylint.d"
5453
DEFAULT_PYLINT_HOME = platformdirs.user_cache_dir("pylint")

pylint/interfaces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def implements(
7373
interface: type[Interface] | tuple[type[Interface], ...],
7474
) -> bool:
7575
"""Does the given object (maybe an instance or class) implement the interface."""
76-
# TODO: 3.0: Remove deprecated function # pylint: disable=fixme
76+
# TODO: 3.0: Remove deprecated function
7777
warnings.warn(
7878
"implements has been deprecated in favour of using basic "
7979
"inheritance patterns without using __implements__.",

pylint/lint/parallel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _worker_check_single_file(
5656
file_item: FileItem,
5757
) -> tuple[
5858
int,
59-
# TODO: 3.0: Make this only str after deprecation has been removed # pylint: disable=fixme
59+
# TODO: 3.0: Make this only str after deprecation has been removed
6060
str | None,
6161
str,
6262
str | None,

pylint/lint/pylinter.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ def __init__(
235235
options: Options = (),
236236
reporter: reporters.BaseReporter | reporters.MultiReporter | None = None,
237237
option_groups: tuple[tuple[str, str], ...] = (),
238-
# pylint: disable-next=fixme
239238
# TODO: Deprecate passing the pylintrc parameter
240239
pylintrc: str | None = None, # pylint: disable=unused-argument
241240
) -> None:
@@ -314,7 +313,7 @@ def __init__(
314313

315314
@property
316315
def option_groups(self) -> tuple[tuple[str, str], ...]:
317-
# TODO: 3.0: Remove deprecated attribute # pylint: disable=fixme
316+
# TODO: 3.0: Remove deprecated attribute
318317
warnings.warn(
319318
"The option_groups attribute has been deprecated and will be removed in pylint 3.0",
320319
DeprecationWarning,
@@ -706,7 +705,6 @@ def check(self, files_or_modules: Sequence[str] | str) -> None:
706705
"""
707706
self.initialize()
708707
if not isinstance(files_or_modules, (list, tuple)):
709-
# pylint: disable-next=fixme
710708
# TODO: 3.0: Remove deprecated typing and update docstring
711709
warnings.warn(
712710
"In pylint 3.0, the checkers check function will only accept sequence of string",
@@ -871,7 +869,7 @@ def set_current_module(
871869
return
872870
self.reporter.on_set_current_module(modname or "", filepath)
873871
if modname is None:
874-
# TODO: 3.0: Remove all modname or ""'s in this method # pylint: disable=fixme
872+
# TODO: 3.0: Remove all modname or ""'s in this method
875873
warnings.warn(
876874
(
877875
"In pylint 3.0 modname should be a string so that it can be used to "
@@ -899,7 +897,7 @@ def _astroid_module_checker(
899897
for c in _checkers
900898
if isinstance(c, checkers.BaseTokenChecker) and c is not self
901899
]
902-
# TODO: 3.0: Remove deprecated for-loop # pylint: disable=fixme
900+
# TODO: 3.0: Remove deprecated for-loop
903901
for c in _checkers:
904902
with warnings.catch_warnings():
905903
warnings.filterwarnings("ignore", category=DeprecationWarning)
@@ -918,7 +916,7 @@ def _astroid_module_checker(
918916
rawcheckers = [
919917
c for c in _checkers if isinstance(c, checkers.BaseRawFileChecker)
920918
]
921-
# TODO: 3.0: Remove deprecated if-statement # pylint: disable=fixme
919+
# TODO: 3.0: Remove deprecated if-statement
922920
for c in _checkers:
923921
with warnings.catch_warnings():
924922
warnings.filterwarnings("ignore", category=DeprecationWarning)
@@ -1006,7 +1004,7 @@ def check_astroid_module(
10061004
ast_node, walker, rawcheckers, tokencheckers
10071005
)
10081006

1009-
# TODO: 3.0: Remove unnecessary assertion # pylint: disable=fixme
1007+
# TODO: 3.0: Remove unnecessary assertion
10101008
assert self.current_name
10111009

10121010
self.stats.by_module[self.current_name]["statement"] = (

pylint/reporters/base_reporter.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def handle_message(self, msg: Message) -> None:
5050

5151
def set_output(self, output: TextIO | None = None) -> None:
5252
"""Set output stream."""
53-
# pylint: disable-next=fixme
5453
# TODO: 3.0: Remove deprecated method
5554
warn(
5655
"'set_output' will be removed in 3.0, please use 'reporter.out = stream' instead",

pylint/reporters/text.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ def colorize_ansi(
130130
131131
:return: the ANSI escaped string
132132
"""
133-
# pylint: disable-next=fixme
134133
# TODO: 3.0: Remove deprecated typing and only accept MessageStyle as parameter
135134
if not isinstance(msg_style, MessageStyle):
136135
warnings.warn(
@@ -257,7 +256,6 @@ def __init__(
257256
) = None,
258257
) -> None:
259258
super().__init__(output)
260-
# pylint: disable-next=fixme
261259
# TODO: 3.0: Remove deprecated typing and only accept ColorMappingDict as color_mapping parameter
262260
if color_mapping and not isinstance(
263261
list(color_mapping.values())[0], MessageStyle

pylint/testutils/checker_test_case.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
class CheckerTestCase:
2222
"""A base testcase class for unit testing individual checker classes."""
2323

24-
# pylint: disable-next=fixme
2524
# TODO: Figure out way to type this as type[BaseChecker] while also
2625
# setting self.checker correctly.
2726
CHECKER_CLASS: Any
@@ -79,7 +78,6 @@ def assertAddsMessages(
7978
assert expected_msg.line == gotten_msg.line, msg
8079
assert expected_msg.col_offset == gotten_msg.col_offset, msg
8180
if PY38_PLUS:
82-
# pylint: disable=fixme
8381
# TODO: 3.0: Remove deprecated missing arguments and remove the warning
8482
if not expected_msg.end_line == gotten_msg.end_line:
8583
warnings.warn( # pragma: no cover

pylint/testutils/unittest_linter.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def add_message(
3838
self,
3939
msgid: str,
4040
line: int | None = None,
41-
# pylint: disable=fixme
4241
# TODO: Make node non optional
4342
node: nodes.NodeNG | None = None,
4443
args: Any = None,

pylintrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ disable=
104104
too-few-public-methods,
105105
# handled by black
106106
format,
107+
# We anticipate #3512 where it will become optional
108+
fixme,
107109

108110

109111
[REPORTS]

tests/pyreverse/test_diadefs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def test_option_values(
8888

8989
def test_default_values() -> None:
9090
"""Test default values for package or class diagrams."""
91-
# TODO : should test difference between default values for package or class diagrams pylint: disable=fixme
91+
# TODO : should test difference between default values for package or class diagrams
9292

9393

9494
class TestDefaultDiadefGenerator:

tests/test_regr.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ def test_check_package___init__(finalize_linter: PyLinter) -> None:
122122
assert checked == ["__init__"]
123123

124124

125-
# pylint: disable-next=fixme
126125
# TODO: 3.0: Test are broken because of property shenanigans of config attribute
127126
# Re-enable after some of the old attributes have been removed after deprecation period
128127
@pytest.mark.xfail

tests/test_self.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ def test_parallel_execution(self) -> None:
253253
def test_parallel_execution_missing_arguments(self) -> None:
254254
self._runtest(["-j 2", "not_here", "not_here_too"], code=1)
255255

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

0 commit comments

Comments
 (0)