Skip to content

Commit a07eca7

Browse files
Deprecate PyLinter pylintrc arg
1 parent 2400732 commit a07eca7

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
The unused ``pylintrc`` argument to ``PyLinter.__init__()`` is deprecated
2+
and will be removed.
3+
4+
Refs #6052

pylint/lint/pylinter.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import sys
1313
import tokenize
1414
import traceback
15+
import warnings
1516
from collections import defaultdict
1617
from collections.abc import Callable, Iterable, Iterator, Sequence
1718
from io import TextIOWrapper
@@ -291,12 +292,18 @@ def __init__(
291292
options: Options = (),
292293
reporter: reporters.BaseReporter | reporters.MultiReporter | None = None,
293294
option_groups: tuple[tuple[str, str], ...] = (),
294-
# TODO: Deprecate passing the pylintrc parameter
295-
pylintrc: str | None = None, # pylint: disable=unused-argument
295+
pylintrc: str | None = None,
296296
) -> None:
297297
_ArgumentsManager.__init__(self, prog="pylint")
298298
_MessageStateHandler.__init__(self, self)
299299

300+
if pylintrc is not None:
301+
warnings.warn(
302+
"The pylintrc argument will be removed in pylint 5.0.",
303+
DeprecationWarning,
304+
stacklevel=2,
305+
)
306+
300307
# Some stuff has to be done before initialization of other ancestors...
301308
# messages store / checkers / reporter / astroid manager
302309

pylint/lint/run.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ def __init__(
172172
self.linter = linter = self.LinterClass(
173173
_make_run_options(self),
174174
option_groups=self.option_groups,
175-
pylintrc=self._rcfile,
176175
)
177176
# register standard checkers
178177
linter.load_default_plugins()

0 commit comments

Comments
 (0)