Skip to content

📝 Path-based instructions for docstring generation #296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ description: The latest updates and changes to CodeRabbit.
sidebar_position: 13
---

## April 19, 2025

### Docstring Path Instructions

You can now provide path-based instructions for the generation of docstring in `.coderabbit.yaml`.

Example:

```yaml
code_generation:
docstrings:
path_instructions:
- path: "**/*.ts"
instructions: |
End all docstrings with a notice that says "Auto-generated by CodeRabbit.".
Do not omit the closing tags; the docstring must be valid.
```

See the [docstrings documentation](/finishing-touches/docstrings#path-instructions) for more details.

## April 14, 2025

### Shopify CLI Integration & Bitbucket Cloud Reporting
Expand Down
14 changes: 14 additions & 0 deletions docs/finishing-touches/docstrings.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ CodeRabbit cannot perform further modifications to opened pull requests. From th

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).

## Path Instructions

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.

```yaml
code_generation:
docstrings:
path_instructions:
- path: "**/*.ts"
instructions: |
End all docstrings with a notice that says "Auto-generated by CodeRabbit.".
Do not omit the closing tags; the docstring must be valid.
```

## Supported software forges

These software forges are supported:
Expand Down