Skip to content

Add a new reference section for code guidelines. #483

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
21 changes: 8 additions & 13 deletions docs/integrations/knowledge-base.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
94 changes: 94 additions & 0 deletions docs/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

<Tabs groupId="config-setting">
<TabItem value="web-ui" label="Web UI">
<table>
<tbody>
<tr>
<td><strong>Location</strong></td>
<td>Knowledge Base > Enabled</td>
</tr>
<tr>
<td><strong>Default</strong></td>
<td>true</td>
</tr>
</tbody></table>
</TabItem>
<TabItem value="yaml" label=".coderabbit.yaml" default>
<table>
<tbody>
<tr>
<td><strong>Field</strong></td>
<td>`knowledge_base.code_guidelines.enabled`</td>
</tr>
<tr>
<td><strong>Datatype</strong></td>
<td>boolean</td>
</tr>
<tr>
<td><strong>Default</strong></td>
<td>`true`</td>
</tr>
</tbody></table>
</TabItem>
</Tabs>

Enable CodeRabbit to enforce your organization's coding standards during reviews.

#### File patterns

<Tabs groupId="config-setting">
<TabItem value="web-ui" label="Web UI">
<table>
<tbody>
<tr>
<td><strong>Location</strong></td>
<td>Knowledge Base > File Patterns</td>
</tr>
<tr>
<td><strong>Default</strong></td>
<td>_No patterns_</td>
</tr>
</tbody></table>
</TabItem>
<TabItem value="yaml" label=".coderabbit.yaml" default>
<table>
<tbody>
<tr>
<td><strong>Field</strong></td>
<td>`knowledge_base.code_guidelines.filePatterns`</td>
</tr>
<tr>
<td><strong>Datatype</strong></td>
<td>array</td>
</tr>
<tr>
<td><strong>Default</strong></td>
<td>`[]`</td>
</tr>
</tbody></table>
</TabItem>
</Tabs>

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
Expand Down
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