summaryrefslogtreecommitdiff
path: root/pylint/utils/ast_walker.py
diff options
context:
space:
mode:
authorNick Drozd <nicholasdrozd@gmail.com>2021-10-25 09:36:39 -0500
committerGitHub <noreply@github.com>2021-10-25 16:36:39 +0200
commitb6ca3b9d6f7ad42accdf90044628521bd711d1ec (patch)
tree493df3452dc727f4bfce142e4d856471d8abbeb4 /pylint/utils/ast_walker.py
parent8cfce138e9519f63e969e89359e86e140b2f0f13 (diff)
downloadpylint-git-b6ca3b9d6f7ad42accdf90044628521bd711d1ec.tar.gz
Enable for_any_all check (#5206)
* Enable for_any_all check, reword a few docstrings, shorten some loop variable names, and add typing on modified functions. Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com> Co-authored-by: Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>
Diffstat (limited to 'pylint/utils/ast_walker.py')
-rw-r--r--pylint/utils/ast_walker.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/pylint/utils/ast_walker.py b/pylint/utils/ast_walker.py
index 756889251..4f76a9805 100644
--- a/pylint/utils/ast_walker.py
+++ b/pylint/utils/ast_walker.py
@@ -19,10 +19,7 @@ class ASTWalker:
def _is_method_enabled(self, method):
if not hasattr(method, "checks_msgs"):
return True
- for msg_desc in method.checks_msgs:
- if self.linter.is_message_enabled(msg_desc):
- return True
- return False
+ return any(self.linter.is_message_enabled(m) for m in method.checks_msgs)
def add_checker(self, checker):
"""walk to the checker's dir and collect visit and leave methods"""