Skip to content

Commit 998e421

Browse files
committed
Add a new reference section for code guidelines. Rewrite the guide section for code guidelines.
1 parent 0f5c94d commit 998e421

File tree

2 files changed

+102
-13
lines changed

2 files changed

+102
-13
lines changed

docs/integrations/knowledge-base.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,15 @@ Watch our [video walkthrough on learnings](https://www.youtube.com/watch?v=Yu0cm
2323

2424
:::
2525

26-
## Code Guidelines {#code_guidelines}
26+
## Code Guidelines {#code-guidelines}
2727

28-
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.
28+
CodeRabbit can read _code guideline_ files that set standards and expectations about
29+
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.
2930

30-
The following patterns are scanned by default.
31+
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
32+
or set of files in your repository as code guideline files by providing CodeRabbit with a list
33+
of paths to those files.
3134

32-
```text
33-
**/.cursorrules
34-
.github/copilot-instructions.md
35-
**/CLAUDE.md
36-
**/.cursor/rules/*
37-
**/.windsurfrules
38-
**/.clinerules/*
39-
**/.rules/*
40-
```
35+
This feature is enabled by default; you can disable it if needed.
4136

42-
![Illustration of code guidelines configuration](/img/knowledge-base/code-guidelines.png)
37+
For more information about configuring the code guidelines feature, see [Code guidelines](/reference/configuration#code-guidelines) in the configuration reference page.

docs/reference/configuration.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,6 +1976,100 @@ Specify the Jira project keys to use for the knowledge base.
19761976

19771977
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.
19781978

1979+
### Code guidelines
1980+
1981+
You can define a list of paths that guide CodeRabbit to your organization's code guidelines.
1982+
If you do, then CodeRabbit applies these guidelines to its code reviews. For more
1983+
information, see [Code Guidelines](/integrations/knowledge-base#code_guidelines).
1984+
1985+
#### Enable code guidelines
1986+
1987+
<Tabs groupId="config-setting">
1988+
<TabItem value="web-ui" label="Web UI">
1989+
<table>
1990+
<tbody>
1991+
<tr>
1992+
<td><strong>Location</strong></td>
1993+
<td>Knowledge Base > Enabled</td>
1994+
</tr>
1995+
<tr>
1996+
<td><strong>Default</strong></td>
1997+
<td>true</td>
1998+
</tr>
1999+
</tbody></table>
2000+
</TabItem>
2001+
<TabItem value="yaml" label=".coderabbit.yaml" default>
2002+
<table>
2003+
<tbody>
2004+
<tr>
2005+
<td><strong>Field</strong></td>
2006+
<td>`knowledge_base.code_guidelines.enabled`</td>
2007+
</tr>
2008+
<tr>
2009+
<td><strong>Datatype</strong></td>
2010+
<td>boolean</td>
2011+
</tr>
2012+
<tr>
2013+
<td><strong>Default</strong></td>
2014+
<td>`true`</td>
2015+
</tr>
2016+
</tbody></table>
2017+
</TabItem>
2018+
</Tabs>
2019+
2020+
Enable CodeRabbit to enforce your organization's coding standards during reviews.
2021+
2022+
#### File patterns
2023+
2024+
<Tabs groupId="config-setting">
2025+
<TabItem value="web-ui" label="Web UI">
2026+
<table>
2027+
<tbody>
2028+
<tr>
2029+
<td><strong>Location</strong></td>
2030+
<td>Knowledge Base > File Patterns</td>
2031+
</tr>
2032+
<tr>
2033+
<td><strong>Default</strong></td>
2034+
<td>_No patterns_</td>
2035+
</tr>
2036+
</tbody></table>
2037+
</TabItem>
2038+
<TabItem value="yaml" label=".coderabbit.yaml" default>
2039+
<table>
2040+
<tbody>
2041+
<tr>
2042+
<td><strong>Field</strong></td>
2043+
<td>`knowledge_base.code_guidelines.filePatterns`</td>
2044+
</tr>
2045+
<tr>
2046+
<td><strong>Datatype</strong></td>
2047+
<td>array</td>
2048+
</tr>
2049+
<tr>
2050+
<td><strong>Default</strong></td>
2051+
<td>`[]`</td>
2052+
</tr>
2053+
</tbody></table>
2054+
</TabItem>
2055+
</Tabs>
2056+
2057+
A list of path specifications to your repository's coding guideline documents, relative
2058+
to the root of your repository. Fileglob matching is allowed. Paths are case-sensitive.
2059+
2060+
If the code guidelines feature is enabled, then CodeRabbit applies code-guideline
2061+
documents found at the following paths, in addition to any paths that you define:
2062+
2063+
- `**/.cursorrules`
2064+
- `.github/copilot-instructions.md`
2065+
- `**/CLAUDE.md`
2066+
- `**/GEMINI.md`
2067+
- `**/.cursor/rules/*`
2068+
- `**/.windsurfrules`
2069+
- `**/.clinerules/*`
2070+
- `**/.rules/*`
2071+
- `**/AGENT.md`
2072+
19792073
### Linear
19802074

19812075
#### Enable Linear

0 commit comments

Comments
 (0)
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