Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve location reporting for ControlFlowParentheses #25927

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/chplcheck/src/rule_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def _check_single(
# addition to the fixits in the result itself)
# add the fixits from the hooks to the fixits from the rule
fixits = self.run_fixit_hooks(context, result) + fixits
return (node, self.name, fixits)
return (result.node, self.name, fixits)

def check(
self, context: chapel.Context, root: chapel.AstNode
Expand Down
2 changes: 1 addition & 1 deletion tools/chplcheck/src/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def ControlFlowParentheses(

# 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(node, data=subject)
return BasicRuleResult(subject, data=subject)

@driver.fixit(ControlFlowParentheses)
def RemoveControlFlowParentheses(context: Context, result: BasicRuleResult):
Expand Down