Skip to content

Commit 1c509ed

Browse files
[cleanup] Remove unused code in pylint.checker.base following refactor
1 parent 1e7d3fa commit 1c509ed

File tree

2 files changed

+3
-34
lines changed

2 files changed

+3
-34
lines changed

pylint/checkers/base/__init__.py

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
33
# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt
44

5-
"""Basic checker for Python code."""
65

76
__all__ = [
87
"NameChecker",
@@ -17,8 +16,6 @@
1716

1817
from typing import TYPE_CHECKING
1918

20-
from astroid import nodes
21-
2219
from pylint.checkers.base.basic_checker import BasicChecker
2320
from pylint.checkers.base.basic_error_checker import BasicErrorChecker
2421
from pylint.checkers.base.comparison_checker import ComparisonChecker
@@ -39,36 +36,6 @@
3936
from pylint.lint import PyLinter
4037

4138

42-
UNITTEST_CASE = "unittest.case"
43-
44-
45-
LOOPLIKE_NODES = (
46-
nodes.For,
47-
nodes.ListComp,
48-
nodes.SetComp,
49-
nodes.DictComp,
50-
nodes.GeneratorExp,
51-
)
52-
53-
54-
def in_loop(node: nodes.NodeNG) -> bool:
55-
"""Return whether the node is inside a kind of for loop."""
56-
return any(isinstance(parent, LOOPLIKE_NODES) for parent in node.node_ancestors())
57-
58-
59-
def in_nested_list(nested_list, obj):
60-
"""Return true if the object is an element of <nested_list> or of a nested
61-
list
62-
"""
63-
for elmt in nested_list:
64-
if isinstance(elmt, (list, tuple)):
65-
if in_nested_list(elmt, obj):
66-
return True
67-
elif elmt == obj:
68-
return True
69-
return False
70-
71-
7239
def register(linter: "PyLinter") -> None:
7340
linter.register_checker(BasicErrorChecker(linter))
7441
linter.register_checker(BasicChecker(linter))

pylint/checkers/base/basic_checker.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
33
# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt
44

5-
"""Permits separating multiple checks with the same checker name into classes/file."""
5+
"""Basic checker for Python code."""
66

77
import collections
88
import itertools
@@ -30,6 +30,8 @@
3030

3131

3232
class _BasicChecker(BaseChecker):
33+
"""Permits separating multiple checks with the same checker name into classes/file."""
34+
3335
__implements__ = IAstroidChecker
3436
name = "basic"
3537

0 commit comments

Comments
 (0)