Add a configuration file
CodeRabbit offers various configuration options to tailor the reviews to yourrequirements. Configuration can be made using one of the below options, in orderof 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. For reference, you can find curated examples of YAML configurations in ourawesome-coderabbit repository.
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 currentconfiguration 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 yourrepositories. Below is a sample YAML file that can be used as a starting pointand changed as needed:
Write your configuration file in the below editor to validate:
.coderabbit.yaml configuration file should exist in the feature branch for CodeRabbit review.
The configuration file can be used to set the following options:
Refer:CodeRabbit Configuration Schema.
Please note that code reviews commence with new pull requests or incrementalcommits to existing pull requests once the CodeRabbit app is installed. Shouldyou have any questions or require assistance, our support team is here to help.
Shared configuration
If you are self-hosting CodeRabbit in an air-gapped environment, you can use theshared configuration feature to share the configuration across multiple repositories.
To use shared configuration, you need to:
- Create a
.coderabbit.yamlfile and host it in a location that is accessibleto from the CodeRabbit instance. - Create a
.coderabbit.yamlfile in the root of your repository with thefollowing content:
remote_config:
url:"https://your-config-location/.coderabbit.yaml"