Skip to content

Commit

Permalink
use advanced rules
Browse files Browse the repository at this point in the history
Signed-off-by: Jade Abraham <[email protected]>
  • Loading branch information
jabraham17 committed Sep 11, 2024
1 parent c38bb38 commit e8b5811
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/chplcheck/src/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit e8b5811

Please sign in to comment.