From 3261d10009c4002eaa488016ceb1f095d9609216 Mon Sep 17 00:00:00 2001 From: Nathan Gendron Date: Tue, 22 Apr 2025 13:13:29 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Path-based=20instructions=20for?= =?UTF-8?q?=20docstring=20generation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/changelog.md | 20 ++++++++++++++++++++ docs/finishing-touches/docstrings.md | 14 ++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index 2b8b9611..bf13d57c 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -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 diff --git a/docs/finishing-touches/docstrings.md b/docs/finishing-touches/docstrings.md index 4de183b5..f57ecd65 100644 --- a/docs/finishing-touches/docstrings.md +++ b/docs/finishing-touches/docstrings.md @@ -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: