From 959569a288b0ff1957ef172b25cc0df39787c7d3 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Thu, 26 Oct 2023 11:43:09 -0700 Subject: [PATCH] Make node an optional argument to should_check_rule. Signed-off-by: Danila Fedorin --- tools/chapel-py/chplcheck/driver.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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):