Skip to content

Conversation

@camchenry
Copy link
Member

@camchenry camchenry commented Oct 16, 2025

is_member_expression_kind is a known method that has a fixed number of AST variants that it will return true for. We already parse this out at the beginning of linter codegen, so we know what variants this will check for. So, we can extend the node types instead of simply bailing out early.

image

Copy link
Member Author

camchenry commented Oct 16, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@github-actions github-actions bot added A-linter Area - Linter C-performance Category - Solution not expected to change functional behavior, only performance labels Oct 16, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 16, 2025

CodSpeed Performance Report

Merging #14677 will not alter performance

Comparing 10-16-perf_linter_add_codegen_support_for_is_member_expression_kind_in_match (f830bea) with main (5ea3bb6)1

Summary

✅ 4 untouched
⏩ 33 skipped2

Footnotes

  1. No successful run was found on main (f830bea) during the generation of this report, so 5ea3bb6 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 33 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@camchenry camchenry marked this pull request as ready for review October 16, 2025 18:31
@camchenry camchenry requested a review from camc314 as a code owner October 16, 2025 18:31
Copilot AI review requested due to automatic review settings October 16, 2025 18:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the linter codegen by adding support for detecting is_member_expression_kind method calls in match expressions. The improvement allows the codegen to recognize when a rule uses this specific method and automatically include the relevant member expression AST variants in the node type set, rather than falling back to incomplete collection.

Key changes:

  • Extended MatchDetector to handle is_member_expression_kind guard expressions in match arms
  • Added dependency on RuleRunnerData to access pre-parsed member expression kinds
  • Modified the detection logic to recognize and process this specific pattern

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
tasks/linter_codegen/src/match_detector.rs Added lifetime parameter, RuleRunnerData dependency, and new pattern matching for is_member_expression_kind method calls
tasks/linter_codegen/src/main.rs Updated function call to pass rule_runner_data parameter to MatchDetector::from_run_func

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 17, 2025

Merge activity

…match (#14677)

`is_member_expression_kind` is a known method that has a fixed number of AST variants that it will return `true` for. We already parse this out at the beginning of linter codegen, so we know what variants this will check for. So, we can extend the node types instead of simply bailing out early.

<img width="713" height="376" alt="image" src="https://github.com/user-attachments/assets/d8e91df3-7ea8-4883-825a-196041e0dbcd" />
@graphite-app graphite-app bot force-pushed the 10-16-perf_linter_add_codegen_support_for_is_member_expression_kind_in_match branch from 9b21901 to f830bea Compare October 17, 2025 10:20
@camc314 camc314 self-assigned this Oct 17, 2025
@graphite-app graphite-app bot merged commit f830bea into main Oct 17, 2025
20 checks passed
@graphite-app graphite-app bot deleted the 10-16-perf_linter_add_codegen_support_for_is_member_expression_kind_in_match branch October 17, 2025 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-performance Category - Solution not expected to change functional behavior, only performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants