Configure CodeRabbit
CodeRabbit offers various configuration options to tailor the reviews to your requirements. Configuration can be made using one of the below options, in order of precedence:
- Configure using CodeRabbit YAML file
- Configure using CodeRabbit UI for each repository
- Configure using CodeRabbit UI for the organization
In this guide, we will cover the configuration using a YAML file.
Configure CodeRabbit using a YAML File
Move existing UI configuration to a YAML file?
Use the @coderabbitai configuration
command on any PR to get the current
configuration in a YAML format. You can then copy the configuration to a
.coderabbit.yaml
file in the root of your repository.
You can add a .coderabbit.yaml
configuration file to the root of your
repositories. Below is a sample YAML file that can be used as a starting point
and changed as needed:
Write your configuration file in the below editor to validate:
The configuration file can be used to set the following options:
Schema
language string
type : stringPossible values :de
de-DE
de-AT
de-CH
en
en-US
en-AU
en-GB
en-CA
en-NZ
en-ZA
es
es-AR
fr
fr-CA
fr-CH
fr-BE
nl
nl-BE
pt-AO
pt
pt-BR
pt-MZ
pt-PT
ar
ast-ES
ast
be-BY
be
br-FR
br
ca-ES
ca
ca-ES-valencia
ca-ES-balear
da-DK
da
de-DE-x-simple-language
el-GR
el
eo
fa
ga-IE
ga
gl-ES
gl
it
ja-JP
ja
km-KH
km
ko-KR
ko
pl-PL
pl
ro-RO
ro
ru-RU
ru
sk-SK
sk
sl-SI
sl
sv
ta-IN
ta
tl-PH
tl
tr
uk-UA
uk
zh-CN
zh
crh-UA
crh
nb
no
nl-NL
de-DE-x-simple-language-DE
es-ES
it-IT
fa-IR
sv-SE
de-LU
fr-FR
Default value :en-US
Set the language for reviews by using the corresponding ISO language code.tone_instructions string
type : stringLength :<= 250 character(s)
Default value :Set the tone of reviews and chat. Example: 'You must use talk like Mr. T. I pity the fool who doesn't!'early_access boolean
type : booleanDefault value :false
Enable early-access features.enable_free_tier boolean
type : booleanDefault value :true
Enable free tier features for users not on a paid plan.reviews object
type : objectprofile string
type : stringPossible values :chill
assertive
Default value :chill
Set the profile for reviews. Assertive profile yields more feedback, that may be considered nitpicky.request_changes_workflow boolean
type : booleanDefault value :false
Approve the review once CodeRabbit's comments are resolved. Note: In GitLab, all discussions must be resolved.high_level_summary boolean
type : booleanDefault value :true
Generate a high level summary of the changes in the PR/MR description.high_level_summary_placeholder string
type : stringDefault value :@coderabbitai summary
Placeholder in the PR/MR description that gets replaced with the high level summary.auto_title_placeholder string
type : stringDefault value :@coderabbitai
Add this keyword in the PR/MR title to auto-generate the title.review_status boolean
type : booleanDefault value :true
Post review details on each review. Additionally, post a review status when a review is skipped in certain cases.poem boolean
type : booleanDefault value :true
Generate a poem in the walkthrough comment.collapse_walkthrough boolean
type : booleanDefault value :false
Generate walkthrough in a markdown collapsible section.sequence_diagrams boolean
type : booleanDefault value :true
Generate sequence diagrams in the walkthrough.path_filters (string,...)[]
type : arrayitems[x]
stringtype : string
Default value :[]
Specify file patterns to exclude or include for a review. Accepts glob patterns. Example: !dist/**, src/**path_instructions (object,...)[]
type : arrayitems[x]
objecttype : objectpath string required
type : stringFile path glob pattern. Example: **/*.jsinstructions string required
type : stringLength :<= 3000 character(s)
Provides specific additional guidelines for code review based on file paths.
🚨 No extra propertie(s) are authorized in this object
Default value :[]
Path Instructions | Provide specific additional guidelines for code review based on file paths.abort_on_close boolean
type : booleanDefault value :true
Abort the in-progress review if the pull request is closed or merged.auto_review object
type : objectenabled boolean
type : booleanDefault value :true
Automatic Review | Automatic code reviewauto_incremental_review boolean
type : booleanDefault value :true
Automatic Incremental Review | Automatic incremental code review on each pushignore_title_keywords (string,...)[]
type : arrayitems[x]
stringtype : string
Default value :[]
Ignore reviewing if the title of the pull request contains any of these keywords (case-insensitive).labels (string,...)[]
type : arrayitems[x]
stringtype : string
Default value :[]
Restrict automatic reviews to only those pull requests that match one of the specified labels.drafts boolean
type : booleanDefault value :false
Review draft PRs/MRs.base_branches (string,...)[]
type : arrayitems[x]
stringtype : string
Default value :[]
Base branches (other than the default branch) to review. Accepts regex patterns.
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
tools object
type : objectast-grep object
type : objectrule_dirs (string,...)[]
type : arrayitems[x]
stringtype : string
List of rules directories.util_dirs (string,...)[]
type : arrayitems[x]
stringtype : string
List of utils directories.essential_rules boolean
type : booleanDefault value :true
Use ast-grep essentials package.packages (string,...)[]
type : arrayitems[x]
stringtype : string
Default value :[]
Predefined packages to be used.
🚨 No extra propertie(s) are authorized in this objectast-grep is a code analysis tool that helps you to find patterns in your codebase using abstract syntax trees patterns.shellcheck object
type : objectenabled boolean
type : booleanDefault value :true
Enable ShellCheck | ShellCheck is a static analysis tool that finds bugs in your shell. | Enable shellcheck integration. | v0.9.0
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
Shellcheck is a static analysis tool that finds bugs in your shell scripts.ruff object
type : objectenabled boolean
type : booleanDefault value :true
Enable Ruff | Ruff is a Python linter and code formatter. | Enable ruff integration. | v0.5.7
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
Ruff is a Python linter and code formatter.markdownlint object
type : objectenabled boolean
type : booleanDefault value :true
Enable Markdownlint | Markdownlint is a static analysis tool for Node.js with a library of rules to enforce standards and consistency for Markdown files. | Enable markdownlint integration. | v0.34.0
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
Markdownlint is a static analysis tool to enforce standards and consistency for Markdown files.github-checks object
type : objectenabled boolean
type : booleanDefault value :true
Enable GitHub Checks | Enable integration, defaults to true | Enable GitHub Checks integration.timeout_ms number
type : numberPossible values :>= 0
AND<= 300000
Default value :90000
Time in milliseconds to wait for all GitHub Checks to conclude.
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
GitHub Checks integration configuration.languagetool object
type : objectenabled boolean
type : booleanDefault value :true
Enable LanguageTool | Enable LanguageTool integration.enabled_rules (string,...)[]
type : arrayitems[x]
stringtype : string
IDs of rules to be enabled. The rule won't run unless 'level' is set to a level that activates the rule.disabled_rules (string,...)[]
type : arrayitems[x]
stringtype : string
IDs of rules to be disabled. Note: EN_UNPAIRED_BRACKETS, and EN_UNPAIRED_QUOTES are always disabled.enabled_categories (string,...)[]
type : arrayitems[x]
stringtype : string
IDs of categories to be enabled.disabled_categories (string,...)[]
type : arrayitems[x]
stringtype : string
IDs of categories to be disabled. Note: TYPOS, TYPOGRAPHY, and CASING are always disabled.enabled_only boolean
type : booleanDefault value :false
Only the rules and categories whose IDs are specified with 'enabledRules' or 'enabledCategories' are enabled.level string
type : stringPossible values :default
picky
Default value :default
If set to 'picky', additional rules will be activated, i.e. rules that you might only find useful when checking formal text.
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
LanguageTool is a style and grammar checker for 30+ languages.biome object
type : objectenabled boolean
type : booleanDefault value :true
Enable Biome | Biome is a fast formatter, linter, and analyzer for web projects. | Enable Biome integration. | v1.8.3
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
Biome is a fast formatter, linter, and analyzer for web projects.hadolint object
type : objectenabled boolean
type : booleanDefault value :true
Enable Hadolint | Hadolint is a Dockerfile linter. | Enable Hadolint integration. | v2.12.0
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
Hadolint is a Dockerfile linter.swiftlint object
type : objectenabled boolean
type : booleanDefault value :true
Enable SwiftLint | SwiftLint is a Swift linter. | Enable SwiftLint integration. | v0.55.1config_file string
type : stringOptional path to the SwiftLint configuration file relative to the repository. This is useful when the configuration file is named differently than the default '.swiftlint.yml' or '.swiftlint.yaml'.
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
SwiftLint integration configuration object.phpstan object
type : objectenabled boolean
type : booleanDefault value :true
Enable PHPStan | PHPStan requires [config file](https://phpstan.org/config-reference#config-file) in your repository root. Please ensure that this file contains the `paths:` parameter. | v1.11.7level string
type : stringPossible values :default
0
1
2
3
4
5
6
7
8
9
max
Default value :default
Level | Specify the [rule level](https://phpstan.org/user-guide/rule-levels) to run. This setting is ignored if your configuration file already has a `level:` parameter.
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
PHPStan is a tool to analyze PHP code.golangci-lint object
type : objectenabled boolean
type : booleanDefault value :true
Enable golangci-lint | golangci-lint is a fast linters runner for Go. | Enable golangci-lint integration. | v1.59.1config_file string
type : stringOptional path to the golangci-lint configuration file relative to the repository. Useful when the configuration file is named differently than the default '.golangci.yml', '.golangci.yaml', '.golangci.toml', '.golangci.json'.
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
golangci-lint is a fast linters runner for Go.yamllint object
type : objectenabled boolean
type : booleanDefault value :true
Enable Yamllint | yamllint is a linter for YAML files. | Enable yamllint integration. | v1.29.0
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
yamllint is a linter for YAML files.gitleaks object
type : objectenabled boolean
type : booleanDefault value :true
Enable Gitleaks | Gitleaks is a secret scanner. | Enable Gitleaks integration. | v8.18.4
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
Gitleaks is a secret scanner.checkov object
type : objectenabled boolean
type : booleanDefault value :true
Enable Checkov | Checkov is a static code analysis tool for infrastructure-as-code files. | v3.2.219
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
Checkov is a static code analysis tool for infrastructure-as-code files.detekt object
type : objectenabled boolean
type : booleanDefault value :true
Enable Detekt | Detekt is a static code analysis tool for Kotlin files. | v1.23.6config_file string
type : stringOptional path to the Detekt configuration file relative to the repository.
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
Detekt is a static code analysis tool for Kotlin files.eslint object
type : objectenabled boolean
type : booleanDefault value :true
Enable ESLint | ESLint is a static code analysis tool for JavaScript files.
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
ESLint is a static code analysis tool for JavaScript files.rubocop object
type : objectenabled boolean
type : booleanDefault value :true
Enable Rubocop | RuboCop is a Ruby static code analyzer (a.k.a. linter ) and code formatter. | v1.65.0
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
RuboCop is a Ruby static code analyzer (a.k.a. linter ) and code formatter.buf object
type : objectenabled boolean
type : booleanDefault value :true
Enable Buf | Buf offers linting for Protobuf files. | v1.36.0
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
Buf offers linting for Protobuf files.regal object
type : objectenabled boolean
type : booleanDefault value :true
Enable Regal | Regal is a linter and language server for Rego. | v0.25.0
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
Regal is a linter and language server for Rego.actionlint object
type : objectenabled boolean
type : booleanDefault value :true
Enable Actionlint | is a static checker for GitHub Actions workflow files. | v1.7.1
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
actionlint is a static checker for GitHub Actions workflow files.
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
Tools that provide additional context to code reviews.
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
Settings related to reviews.chat object
type : objectauto_reply boolean
type : booleanDefault value :true
Enable the bot to reply automatically without requiring the user to tag it.
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
knowledge_base object
type : objectopt_out boolean
type : booleanDefault value :false
Opt out | Opt out of all knowledge base features.learnings object
type : objectscope string
type : stringPossible values :local
global
auto
Default value :auto
Learnings | 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.
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
issues object
type : objectscope string
type : stringPossible values :local
global
auto
Default value :auto
Issues | Specify the scope of git platform (GitHub/GitLab) issues to use for the knowledge base. 'local' uses the repository's issues, 'global' uses the organization's issues, and 'auto' uses repository's issues for public repositories and organization's issues for private repositories.
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
jira object
type : objectproject_keys (string,...)[]
type : arrayitems[x]
stringtype : string
Default value :[]
Jira Project Keys | Specify the Jira project keys to use for the knowledge base.
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
linear object
type : objectteam_keys (string,...)[]
type : arrayitems[x]
stringtype : string
Default value :[]
Linear Team Keys | Specify the Linear project keys to use for the knowledge base.
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
pull_requests object
type : objectscope string
type : stringPossible values :local
global
auto
Default value :auto
Pull Requests | Specify the scope of pull requests to use for the knowledge base. 'local' uses the repository's pull requests, 'global' uses the organization's pull requests, and 'auto' uses repository's pull requests for public repositories and organization's pull requests for private repositories.
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
🚨 No extra propertie(s) are authorized in this objectDefault value :{}
Refer: CodeRabbit Configuration Schema.
Please note that code reviews commence with new pull requests or incremental commits to existing pull requests once the CodeRabbit app is installed. Should you have any questions or require assistance, our support team is here to help.