test_match_code_rule
Test code against ast-grep YAML rules to verify pattern matching before applying to projects. Validate rule accuracy by scanning code samples.
Instructions
Test a code against an ast-grep YAML rule. This is useful to test a rule before using it in a project.
Internally calls: ast-grep scan --inline-rules --json --stdin
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The code to test against the rule | |
| yaml | Yes | The ast-grep YAML rule to search. It must have id, language, rule fields. |