From e8b5811728340a497fc30862481b6c8565e67f56 Mon Sep 17 00:00:00 2001 From: Jade Abraham Date: Wed, 11 Sep 2024 09:34:24 -0700 Subject: [PATCH] use advanced rules Signed-off-by: Jade Abraham --- tools/chplcheck/src/rules.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/chplcheck/src/rules.py b/tools/chplcheck/src/rules.py index 4bd42fe035f7..5370dd946ccd 100644 --- a/tools/chplcheck/src/rules.py +++ b/tools/chplcheck/src/rules.py @@ -277,9 +277,11 @@ def ControlFlowParentheses( if paren_loc is None: return True + # conditionals don't support the ignore + anchor = node if isinstance(node, Loop) else None # Now, we should warn: there's a node in a conditional or # if/else, it has parentheses at the top level, but it doesn't need them. - return BasicRuleResult(subject, data=subject) + return AdvancedRuleResult(subject, anchor=anchor, data=subject) @driver.fixit(ControlFlowParentheses) def RemoveControlFlowParentheses(context: Context, result: BasicRuleResult):