@@ -20,7 +20,8 @@ def lint(parse_tree: Tree, config: MappingProxyType) -> List[Problem]:
20
20
),
21
21
] # type: List[Tuple[str, Callable]]
22
22
problem_clusters = (
23
- x [1 ](parse_tree ) if x [0 ] not in disable else [] for x in checks_to_run_w_tree
23
+ function (parse_tree ) if name not in disable else []
24
+ for name , function in checks_to_run_w_tree
24
25
)
25
26
problems = [problem for cluster in problem_clusters for problem in cluster ]
26
27
checks_to_run_w_ast = [
@@ -31,7 +32,8 @@ def lint(parse_tree: Tree, config: MappingProxyType) -> List[Problem]:
31
32
]
32
33
ast = AbstractSyntaxTree (parse_tree )
33
34
problem_clusters = (
34
- x [1 ](ast ) if x [0 ] not in disable else [] for x in checks_to_run_w_ast
35
+ function (ast ) if name not in disable else []
36
+ for name , function in checks_to_run_w_ast
35
37
)
36
38
problems += [problem for cluster in problem_clusters for problem in cluster ]
37
39
return problems
@@ -50,7 +52,7 @@ def _private_method_call_check(parse_tree: Tree) -> List[Problem]:
50
52
and called .value == "self"
51
53
):
52
54
continue
53
- if not _is_method_private (callee_name ):
55
+ if is_function_public (callee_name ):
54
56
continue
55
57
problems .append (
56
58
Problem (
@@ -63,11 +65,6 @@ def _private_method_call_check(parse_tree: Tree) -> List[Problem]:
63
65
return problems
64
66
65
67
66
- # TODO: drop
67
- def _is_method_private (method_name : str ) -> bool :
68
- return method_name .startswith ("_" ) # TODO: consider making configurable
69
-
70
-
71
68
def _class_definitions_order_check (
72
69
order : List [str ], ast : AbstractSyntaxTree
73
70
) -> List [Problem ]:
0 commit comments