Skip to main content

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:

  1. Configure using CodeRabbit YAML file
  2. Configure using CodeRabbit UI for each repository
  3. 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

tip

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:

# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
language: "en-US"
early_access: false
reviews:
profile: "chill"
request_changes_workflow: false
high_level_summary: true
poem: true
review_status: true
collapse_walkthrough: false
auto_review:
enabled: true
drafts: false
chat:
auto_reply: true
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The configuration file can be used to set the following options:

Schema
type : object
  • language string
    type : string
    Possible 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 : string
    Length : <= 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 : boolean
    Default value : false
    Enable early-access features.
  • enable_free_tier boolean
    type : boolean
    Default value : true
    Enable free tier features for users not on a paid plan.
  • reviews object
    type : object
    • profile string
      type : string
      Possible 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 : boolean
      Default value : false
      Approve the review once CodeRabbit's comments are resolved. Note: In GitLab, all discussions must be resolved.
    • high_level_summary boolean
      type : boolean
      Default value : true
      Generate a high level summary of the changes in the PR/MR description.
    • high_level_summary_placeholder string
      type : string
      Default value : @coderabbitai summary
      Placeholder in the PR/MR description that gets replaced with the high level summary.
    • auto_title_placeholder string
      type : string
      Default value : @coderabbitai
      Add this keyword in the PR/MR title to auto-generate the title.
    • review_status boolean
      type : boolean
      Default value : true
      Post review details on each review. Additionally, post a review status when a review is skipped in certain cases.
    • poem boolean
      type : boolean
      Default value : true
      Generate a poem in the walkthrough comment.
    • collapse_walkthrough boolean
      type : boolean
      Default value : false
      Generate walkthrough in a markdown collapsible section.
    • sequence_diagrams boolean
      type : boolean
      Default value : true
      Generate sequence diagrams in the walkthrough.
    • path_filters (string,...)[]
      type : array
      • items[x] string
        type : string
      Default value : 
      []
      Specify file patterns to exclude or include for a review. Accepts glob patterns. Example: !dist/**, src/**
    • path_instructions (object,...)[]
      type : array
      • items[x] object
        type : object
        • path string required
          type : string
          File path glob pattern. Example: **/*.js
        • instructions string required
          type : string
          Length : <= 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 : boolean
      Default value : true
      Abort the in-progress review if the pull request is closed or merged.
    • auto_review object
      type : object
      • enabled boolean
        type : boolean
        Default value : true
        Automatic Review | Automatic code review
      • auto_incremental_review boolean
        type : boolean
        Default value : true
        Automatic Incremental Review | Automatic incremental code review on each push
      • ignore_title_keywords (string,...)[]
        type : array
        • items[x] string
          type : string
        Default value : 
        []
        Ignore reviewing if the title of the pull request contains any of these keywords (case-insensitive).
      • labels (string,...)[]
        type : array
        • items[x] string
          type : string
        Default value : 
        []
        Restrict automatic reviews to only those pull requests that match one of the specified labels.
      • drafts boolean
        type : boolean
        Default value : false
        Review draft PRs/MRs.
      • base_branches (string,...)[]
        type : array
        • items[x] string
          type : string
        Default value : 
        []
        Base branches (other than the default branch) to review. Accepts regex patterns.
      🚨 No extra propertie(s) are authorized in this object
      Default value : 
      {}
    • tools object
      type : object
      • ast-grep object
        type : object
        • rule_dirs (string,...)[]
          type : array
          • items[x] string
            type : string
          List of rules directories.
        • util_dirs (string,...)[]
          type : array
          • items[x] string
            type : string
          List of utils directories.
        • essential_rules boolean
          type : boolean
          Default value : true
          Use ast-grep essentials package.
        • packages (string,...)[]
          type : array
          • items[x] string
            type : string
          Default value : 
          []
          Predefined packages to be used.
        🚨 No extra propertie(s) are authorized in this object
        ast-grep is a code analysis tool that helps you to find patterns in your codebase using abstract syntax trees patterns.
      • shellcheck object
        type : object
        • enabled boolean
          type : boolean
          Default 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 object
        Default value : 
        {}
        Shellcheck is a static analysis tool that finds bugs in your shell scripts.
      • ruff object
        type : object
        • enabled boolean
          type : boolean
          Default 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 object
        Default value : 
        {}
        Ruff is a Python linter and code formatter.
      • markdownlint object
        type : object
        • enabled boolean
          type : boolean
          Default 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 object
        Default value : 
        {}
        Markdownlint is a static analysis tool to enforce standards and consistency for Markdown files.
      • github-checks object
        type : object
        • enabled boolean
          type : boolean
          Default value : true
          Enable GitHub Checks | Enable integration, defaults to true | Enable GitHub Checks integration.
        • timeout_ms number
          type : number
          Possible 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 object
        Default value : 
        {}
        GitHub Checks integration configuration.
      • languagetool object
        type : object
        • enabled boolean
          type : boolean
          Default value : true
          Enable LanguageTool | Enable LanguageTool integration.
        • enabled_rules (string,...)[]
          type : array
          • items[x] string
            type : 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 : array
          • items[x] string
            type : string
          IDs of rules to be disabled. Note: EN_UNPAIRED_BRACKETS, and EN_UNPAIRED_QUOTES are always disabled.
        • enabled_categories (string,...)[]
          type : array
          • items[x] string
            type : string
          IDs of categories to be enabled.
        • disabled_categories (string,...)[]
          type : array
          • items[x] string
            type : string
          IDs of categories to be disabled. Note: TYPOS, TYPOGRAPHY, and CASING are always disabled.
        • enabled_only boolean
          type : boolean
          Default value : false
          Only the rules and categories whose IDs are specified with 'enabledRules' or 'enabledCategories' are enabled.
        • level string
          type : string
          Possible 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 object
        Default value : 
        {}
        LanguageTool is a style and grammar checker for 30+ languages.
      • biome object
        type : object
        • enabled boolean
          type : boolean
          Default 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 object
        Default value : 
        {}
        Biome is a fast formatter, linter, and analyzer for web projects.
      • hadolint object
        type : object
        • enabled boolean
          type : boolean
          Default value : true
          Enable Hadolint | Hadolint is a Dockerfile linter. | Enable Hadolint integration. | v2.12.0
        🚨 No extra propertie(s) are authorized in this object
        Default value : 
        {}
        Hadolint is a Dockerfile linter.
      • swiftlint object
        type : object
        • enabled boolean
          type : boolean
          Default value : true
          Enable SwiftLint | SwiftLint is a Swift linter. | Enable SwiftLint integration. | v0.55.1
        • config_file string
          type : string
          Optional 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 object
        Default value : 
        {}
        SwiftLint integration configuration object.
      • phpstan object
        type : object
        • enabled boolean
          type : boolean
          Default 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.7
        • level string
          type : string
          Possible 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 object
        Default value : 
        {}
        PHPStan is a tool to analyze PHP code.
      • golangci-lint object
        type : object
        • enabled boolean
          type : boolean
          Default value : true
          Enable golangci-lint | golangci-lint is a fast linters runner for Go. | Enable golangci-lint integration. | v1.59.1
        • config_file string
          type : string
          Optional 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 object
        Default value : 
        {}
        golangci-lint is a fast linters runner for Go.
      • yamllint object
        type : object
        • enabled boolean
          type : boolean
          Default 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 object
        Default value : 
        {}
        yamllint is a linter for YAML files.
      • gitleaks object
        type : object
        • enabled boolean
          type : boolean
          Default value : true
          Enable Gitleaks | Gitleaks is a secret scanner. | Enable Gitleaks integration. | v8.18.4
        🚨 No extra propertie(s) are authorized in this object
        Default value : 
        {}
        Gitleaks is a secret scanner.
      • checkov object
        type : object
        • enabled boolean
          type : boolean
          Default 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 object
        Default value : 
        {}
        Checkov is a static code analysis tool for infrastructure-as-code files.
      • detekt object
        type : object
        • enabled boolean
          type : boolean
          Default value : true
          Enable Detekt | Detekt is a static code analysis tool for Kotlin files. | v1.23.6
        • config_file string
          type : string
          Optional path to the Detekt configuration file relative to the repository.
        🚨 No extra propertie(s) are authorized in this object
        Default value : 
        {}
        Detekt is a static code analysis tool for Kotlin files.
      • eslint object
        type : object
        • enabled boolean
          type : boolean
          Default value : true
          Enable ESLint | ESLint is a static code analysis tool for JavaScript files.
        🚨 No extra propertie(s) are authorized in this object
        Default value : 
        {}
        ESLint is a static code analysis tool for JavaScript files.
      • rubocop object
        type : object
        • enabled boolean
          type : boolean
          Default 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 object
        Default value : 
        {}
        RuboCop is a Ruby static code analyzer (a.k.a. linter ) and code formatter.
      • buf object
        type : object
        • enabled boolean
          type : boolean
          Default value : true
          Enable Buf | Buf offers linting for Protobuf files. | v1.36.0
        🚨 No extra propertie(s) are authorized in this object
        Default value : 
        {}
        Buf offers linting for Protobuf files.
      • regal object
        type : object
        • enabled boolean
          type : boolean
          Default value : true
          Enable Regal | Regal is a linter and language server for Rego. | v0.25.0
        🚨 No extra propertie(s) are authorized in this object
        Default value : 
        {}
        Regal is a linter and language server for Rego.
      • actionlint object
        type : object
        • enabled boolean
          type : boolean
          Default value : true
          Enable Actionlint | is a static checker for GitHub Actions workflow files. | v1.7.1
        🚨 No extra propertie(s) are authorized in this object
        Default value : 
        {}
        actionlint is a static checker for GitHub Actions workflow files.
      🚨 No extra propertie(s) are authorized in this object
      Default value : 
      {}
      Tools that provide additional context to code reviews.
    🚨 No extra propertie(s) are authorized in this object
    Default value : 
    {}
    Settings related to reviews.
  • chat object
    type : object
    • auto_reply boolean
      type : boolean
      Default value : true
      Enable the bot to reply automatically without requiring the user to tag it.
    🚨 No extra propertie(s) are authorized in this object
    Default value : 
    {}
  • knowledge_base object
    type : object
    • opt_out boolean
      type : boolean
      Default value : false
      Opt out | Opt out of all knowledge base features.
    • learnings object
      type : object
      • scope string
        type : string
        Possible 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 object
      Default value : 
      {}
    • issues object
      type : object
      • scope string
        type : string
        Possible 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 object
      Default value : 
      {}
    • jira object
      type : object
      • project_keys (string,...)[]
        type : array
        • items[x] string
          type : 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 object
      Default value : 
      {}
    • linear object
      type : object
      • team_keys (string,...)[]
        type : array
        • items[x] string
          type : 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 object
      Default value : 
      {}
    • pull_requests object
      type : object
      • scope string
        type : string
        Possible 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 object
      Default value : 
      {}
    🚨 No extra propertie(s) are authorized in this object
    Default value : 
    {}
🚨 No extra propertie(s) are authorized in this object

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.