diff --git a/tools/chapel-py/chplcheck/driver.py b/tools/chapel-py/chplcheck/driver.py index c9fe2907a94b..a1e470f55213 100644 --- a/tools/chapel-py/chplcheck/driver.py +++ b/tools/chapel-py/chplcheck/driver.py @@ -71,7 +71,7 @@ def enable_rules(self, *rules): self.SilencedRules = list(set(self.SilencedRules) - set(rules)) - def _should_check_rule(self, node, rulename): + def _should_check_rule(self,rulename, node = None): if rulename in self.SilencedRules: return False @@ -85,11 +85,11 @@ def _check_basic_rule(self, context, root, rule): # If we should ignore the rule no matter the node, no reason to run # a traversal and match the pattern. - if not self._should_check_rule(None, name): + if not self._should_check_rule(name): return for (node, _) in chapel.each_matching(root, nodetype): - if not self._should_check_rule(node, name): + if not self._should_check_rule(name, node): continue if not func(context, node): @@ -100,7 +100,7 @@ def _check_advanced_rule(self, context, root, rule): # If we should ignore the rule no matter the node, no reason to run # a traversal and match the pattern. - if not self._should_check_rule(None, name): + if not self._should_check_rule(name): return for node in func(context, root):