Skip to content

Commit 163c570

Browse files
authored
📝 Path-based instructions for docstring generation (#296)
1 parent 9272f78 commit 163c570

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

docs/changelog.md

+20
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,26 @@ description: The latest updates and changes to CodeRabbit.
55
sidebar_position: 13
66
---
77

8+
## April 19, 2025
9+
10+
### Docstring Path Instructions
11+
12+
You can now provide path-based instructions for the generation of docstring in `.coderabbit.yaml`.
13+
14+
Example:
15+
16+
```yaml
17+
code_generation:
18+
docstrings:
19+
path_instructions:
20+
- path: "**/*.ts"
21+
instructions: |
22+
End all docstrings with a notice that says "Auto-generated by CodeRabbit.".
23+
Do not omit the closing tags; the docstring must be valid.
24+
```
25+
26+
See the [docstrings documentation](/finishing-touches/docstrings#path-instructions) for more details.
27+
828
## April 14, 2025
929
1030
### Shopify CLI Integration & Bitbucket Cloud Reporting

docs/finishing-touches/docstrings.md

+14
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,20 @@ CodeRabbit cannot perform further modifications to opened pull requests. From th
3333

3434
This feature has been rigorously tested and is now available for all Pro plan users. Additionally, you can provide feedback about this feature on [Discord](https://discord.com/channels/1134356397673414807/1317286905557287022).
3535

36+
## Path Instructions
37+
38+
You can customize the generated docstrings by providing instructions based on file paths in your `.coderabbit.yaml`. The `path` is a [minimatch](https://github.com/isaacs/minimatch) pattern.
39+
40+
```yaml
41+
code_generation:
42+
docstrings:
43+
path_instructions:
44+
- path: "**/*.ts"
45+
instructions: |
46+
End all docstrings with a notice that says "Auto-generated by CodeRabbit.".
47+
Do not omit the closing tags; the docstring must be valid.
48+
```
49+
3650
## Supported software forges
3751
3852
These software forges are supported:

0 commit comments

Comments
 (0)