Configuration Options
You can configure ast-grep in your.coderabbit.yaml file or through CodeRabbitâs settings page under âReviews â Tools â ast-grepâ. The following options are available:
rule_dirs: List of directories containing your custom ast-grep rules, relative to the repository root (default:[])util_dirs: List of directories containing utility configs to support rule management, relative to the repository root (default:[])essential_rules: Enable the ast-grep essentials package (default:true)packages: List of GitHub packages to use inowner/repositoryformat (default:[])
Example Configuration
CodeRabbit will only run ast-grep if you have configured at least one of the following:
- Custom rule directories (
rule_dirs) - Essential rules enabled (
essential_rules: true) - Custom packages (
packages)
util_dirs can be used to support shared utility configs, but by itself it does not cause ast-grep to run.CodeRabbit also skips ast-grep when the pull request contains no changed files with a supported extension. Individual files that are 8 MiB or larger are skipped.Links
- ast-grep Documentation
- Writing ast-grep Rules
- ast-grep Rule Object Properties
- ast-grep Essentials Package
Files
ast-grep runs on changed files with the following extensions:.bash.c.cpp.cs.css.erb(parsed as HTML).ex.exs.go.h.hpp.hs.html.java.js.json.jsx.kt.lua.php.py.rb.rs.scala.sh.sql.swift.ts.tsx.yaml.yml