File tree 1 file changed +25
-2
lines changed
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
27
27
### ** Setting up AST-Grep rules**
28
28
By default, users can add AST-Grep rules by following these steps:
29
29
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.
32
32
3 . Ensure each ` .yaml ` file contains the necessary AST-Grep rule configurations.
33
33
4 . 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
+ ```
34
44
35
45
### ** The rule object**
36
46
@@ -159,6 +169,19 @@ my-awesome-project # project root
159
169
| |- is-literal.yml
160
170
` ` `
161
171
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
+
162
185
` ` ` yaml
163
186
# is-literal.yml
164
187
id: is-literal
You can’t perform that action at this time.
0 commit comments