-
-
Notifications
You must be signed in to change notification settings - Fork 690
perf(linter): switch if !matches!(node.kind(), ...) to match block
#14650
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
perf(linter): switch if !matches!(node.kind(), ...) to match block
#14650
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. |
CodSpeed Performance ReportMerging #14650 will not alter performanceComparing Summary
Footnotes
|
cf235ec to
d1868c6
Compare
46ec4b6 to
f2c33f5
Compare
d1868c6 to
00e64a8
Compare
Merge activity
|
…14650) Adding support for `matches!` in the linter codegen would be somewhat tedious as we'd need to start parsing macros. Instead, there is a similar idiom that we already support: diverging `match` on `node.kind()`. So, I've updated the linter codegen to support `|` in match arms, plus updated rules to use this new pattern instead of `if !matches!(...)`. <img width="1392" height="664" alt="CleanShot 2025-10-16 at 12 12 45@2x" src="https://github.com/user-attachments/assets/75762f93-152a-49e4-83ab-46240d7b2b62" />
00e64a8 to
400a99a
Compare

Adding support for
matches!in the linter codegen would be somewhat tedious as we'd need to start parsing macros. Instead, there is a similar idiom that we already support: divergingmatchonnode.kind(). So, I've updated the linter codegen to support|in match arms, plus updated rules to use this new pattern instead ofif !matches!(...).