CodeRabbit Documentation

repository·main·Indexed 19 days ago

https://github.com/coderabbitai/awesome-coderabbit

AI-powered code review tool for improving code quality via intelligent feedback on pull requests. Includes guides on YAML configuration for review profiles and tone, REST API reference, and integration workflows for Azure DevOps, Linear, and CI/CD pipelines.

Tokens
1.2K
Snippets
2
Records
4
Agent score
15%

What's inside CodeRabbit

  1. Integrate CodeRabbit with Azure DevOps, CI/CD, or Linear

    main

    CodeRabbit supports various integration workflows to fit into existing development lifecycles:

    • Azure DevOps: Integration guide for Azure DevOps environments.
    • CI/CD Pipelines: Adding AI-powered static analysis directly into your CI/CD pipelines.
    • Linear: Validating issues against your Linear board.
    • DevOps Pipelines: Comprehensive guide for integrating AI code reviews into general DevOps pipelines.
  2. Configure CodeRabbit via YAML

    main

    CodeRabbit can be customized using a YAML configuration file. This allows you to define the review tone, review profiles, automatic review settings, and path-specific instructions.

    Key configuration sections include:

    • tone_instructions: Sets the persona and style of the AI reviewer.
    • reviews: Configures the review profile (e.g., chill), high-level summaries, and workflow behaviors.
    • auto_review: Controls whether reviews happen automatically and which branches are targeted via base_branches.
    • path_instructions: Provides specific rules for certain file patterns (e.g., testing directories).
    • chat: Configures interaction settings like auto_reply.

    The configuration schema can be validated using: $schema=https://coderabbit.ai/integrations/schema.v2.json.

    # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
    language: "en-US"
    early_access: false
    tone_instructions: 'You are an expert code reviewer in Java, TypeScript, JavaScript, and NodeJS. You work in an enterprise software developer team, providing concise and clear code review advice. You only elaborate or provide detailed explanations when requested.'
    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
        base_branches: ["pg", "release"]
      path_instructions:
        - path: "app/client/cypress/**/**.*"
          instructions: |
            Review the following e2e test code written using the Cypress test library. Ensure that:
            - Follow best practices for Cypress code and e2e automation
            - Avoid using cy.wait in code
            - Avoid using cy.pause in code
            - Avoid using agHelper.sleep()
            - Use locator variables for locators
            - Use data-* attributes for selectors
            - Avoid Xpaths, Attributes and CSS path
            - Avoid selectors like .btn.submit
            - Perform logins via API
            - Avoid using it.only
            - Use multiple assertions
            - Avoid string assertions
            - Ensure unique filenames
    chat:
      auto_reply: true