This repository was archived by the owner on Aug 16, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -27,10 +27,20 @@ This documentation provides guidance on integrating AST-Grep rules within the Co
2727### ** Setting up AST-Grep rules**
2828By default, users can add AST-Grep rules by following these steps:
2929
30- 1 . Create a folder named ` rules ` in your project directory.
31- 2 . Add individual ` .yaml ` files for each AST-Grep rule within the ` rules ` folder.
30+ 1 . Create a folder that keeps all the ` custom-name ` in your project directory.
31+ 2 . Add individual ` .yaml ` files for each AST-Grep rule within the ` custom-name ` folder.
32323 . Ensure each ` .yaml ` file contains the necessary AST-Grep rule configurations.
33334 . Ensure that all rules contains a ` message ` property, that is going to be used on the review process.
34+ 5 . Add the ` custom-name ` folder to the ` .code-rabbit.yml ` file under ` tools.ast_grep ` configuration.
35+ ``` yaml
36+ # ...
37+ reviews :
38+ # ...
39+ tools :
40+ ast_grep :
41+ rules_folder : " custom-name"
42+ # ...
43+ ```
3444
3545### ** The rule object**
3646
@@ -159,6 +169,19 @@ my-awesome-project # project root
159169 | |- is-literal.yml
160170` ` `
161171
172+ >Also, you need to add the `rules` and `utils` folders to the `.code-rabbit.yml` file under `tools.ast_grep` configuration.
173+
174+ ` ` ` yaml
175+ #...
176+ reviews:
177+ #...
178+ tools:
179+ ast_grep:
180+ rules_folder: "rules"
181+ utils_folder: "utils"
182+ #...
183+ ` ` `
184+
162185` ` ` yaml
163186# is-literal.yml
164187id: is-literal
You can’t perform that action at this time.
0 commit comments