perf(linter/curly): avoid additional parent AST lookup#17222
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Merge activity
|
There was a problem hiding this comment.
Pull request overview
This PR optimizes the curly linter rule by eliminating an unnecessary parent AST lookup. Instead of querying the AST to determine if a statement is within a do-while loop, the code now passes this information as a boolean parameter derived from the keyword already available in the context.
- Adds an
is_do_whileparameter toapply_rule_fixto avoid parent node lookup - Computes
is_do_whilefrom the existingkeywordparameter usingkeyword == "do" - Removes the expensive
ctx.nodes().parent_kind()call that was previously needed
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging #17222 will not alter performanceComparing Summary
Footnotes
|
221607f to
c48c406
Compare

Ref #17221