From 998e421900c7897c52e752262bfb2702f7cab896 Mon Sep 17 00:00:00 2001 From: Jason McIntosh Date: Thu, 31 Jul 2025 15:33:08 -0400 Subject: [PATCH] Add a new reference section for code guidelines. Rewrite the guide section for code guidelines. --- docs/integrations/knowledge-base.md | 21 +++---- docs/reference/configuration.md | 94 +++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 13 deletions(-) diff --git a/docs/integrations/knowledge-base.md b/docs/integrations/knowledge-base.md index 1da862e0..3ed0506d 100644 --- a/docs/integrations/knowledge-base.md +++ b/docs/integrations/knowledge-base.md @@ -23,20 +23,15 @@ Watch our [video walkthrough on learnings](https://www.youtube.com/watch?v=Yu0cm ::: -## Code Guidelines {#code_guidelines} +## Code Guidelines {#code-guidelines} -CodeRabbit will analyse and learn from your organisation's code guidelines, which you can set up in the knowledge base section. These guidelines will then be used to conduct thorough code reviews. +CodeRabbit can read _code guideline_ files that set standards and expectations about +your team's coding practices, described in natural language. CodeRabbit applies any instructions it reads from a repository's code guideline files to all subsequent code reviews. -The following patterns are scanned by default. +By default, CodeRabbit looks for the standard guideline files used by other AI coding assistants, including Claude Code, Cursor, and Windsurf. You can also mark any other file +or set of files in your repository as code guideline files by providing CodeRabbit with a list +of paths to those files. -```text -**/.cursorrules -.github/copilot-instructions.md -**/CLAUDE.md -**/.cursor/rules/* -**/.windsurfrules -**/.clinerules/* -**/.rules/* -``` +This feature is enabled by default; you can disable it if needed. -![Illustration of code guidelines configuration](/img/knowledge-base/code-guidelines.png) +For more information about configuring the code guidelines feature, see [Code guidelines](/reference/configuration#code-guidelines) in the configuration reference page. diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md index 5b59933f..24d90db1 100644 --- a/docs/reference/configuration.md +++ b/docs/reference/configuration.md @@ -1976,6 +1976,100 @@ Specify the Jira project keys to use for the knowledge base. Specify the scope of learnings to use for the knowledge base. 'local' uses the repository's learnings, 'global' uses the organization's learnings, and 'auto' uses repository's learnings for public repositories and organization's learnings for private repositories. +### Code guidelines + +You can define a list of paths that guide CodeRabbit to your organization's code guidelines. +If you do, then CodeRabbit applies these guidelines to its code reviews. For more +information, see [Code Guidelines](/integrations/knowledge-base#code_guidelines). + +#### Enable code guidelines + + + + + + + + + + + + + +
LocationKnowledge Base > Enabled
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`knowledge_base.code_guidelines.enabled`
Datatypeboolean
Default`true`
+
+
+ +Enable CodeRabbit to enforce your organization's coding standards during reviews. + +#### File patterns + + + + + + + + + + + + + +
LocationKnowledge Base > File Patterns
Default_No patterns_
+
+ + + + + + + + + + + + + + + +
Field`knowledge_base.code_guidelines.filePatterns`
Datatypearray
Default`[]`
+
+
+ +A list of path specifications to your repository's coding guideline documents, relative +to the root of your repository. Fileglob matching is allowed. Paths are case-sensitive. + +If the code guidelines feature is enabled, then CodeRabbit applies code-guideline +documents found at the following paths, in addition to any paths that you define: + +- `**/.cursorrules` +- `.github/copilot-instructions.md` +- `**/CLAUDE.md` +- `**/GEMINI.md` +- `**/.cursor/rules/*` +- `**/.windsurfrules` +- `**/.clinerules/*` +- `**/.rules/*` +- `**/AGENT.md` + ### Linear #### Enable Linear pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy