diff --git a/docs/changelog.md b/docs/changelog.md index 474cc733..6a21a8ab 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -5,6 +5,50 @@ description: The latest updates and changes to CodeRabbit. sidebar_position: 13 --- +## May 19, 2025 + +### Lua Support with Luacheck + +We're excited to announce enhanced support for Lua code analysis with [Luacheck](https://github.com/mpeterv/luacheck), a powerful static analyzer and linter for Lua code. + +## May 14, 2025 + +### CodeRabbit for VS Code, Cursor, and Windsurf Is Here ๐ŸŽ‰ + +We're thrilled to announce that CodeRabbit's AI code reviews have officially landed inside **VS Code and all its forks, including Cursor and Windsurf!** No more review bottlenecks or context switches: now you can get _instant, inline feedback right in your editor, completely free._ + +**Why you'll love it:** + +- ๐Ÿ“ **Inline Code Reviews**: Senior-dev-level annotation on every line. CodeRabbit becomes your AI pair programmer, annotating staged & unstaged commits before you even open a PR. +- ๐Ÿš€ **Built for Flow, Not Friction**: Code, review, commitโ€”rise & repeat without breaking your flow state. Reviews run automatically on every commit so you ship faster. +- ๐Ÿ› ๏ธ **Fix-with-AI**: One-Click Fix for quick tweaks; "Fix with AI" hands off more complex suggestions to your favorite coding agent, complete with full context. +- ๐Ÿงฉ **Compatible with Cursor, Windsurf & Language-Agnostic**: Works out of the box on VS Code, Cursor, Windsurf. Supports Java, JavaScript, PHP, Python, TypeScript, Go, Ruby, and more. + +Pair these IDE-embedded reviews with our deeper Git-platform reviews for a multi-layered approach that catches more bugs and cuts down overall review time. + +- [Join the launch discussion on Discord](https://discord.com/channels/1134356397673414807/1145813948193575023/1372210767838842950) +- [Install the CodeRabbit VSCode Extension](https://coderabbit.link/vscode) + +## April 19, 2025 + +### Docstring Path Instructions + +You can now provide path-based instructions for the generation of docstring in `.coderabbit.yaml`. + +Example: + +```yaml +code_generation: + docstrings: + path_instructions: + - path: "**/*.ts" + instructions: | + End all docstrings with a notice that says "Auto-generated by CodeRabbit.". + Do not omit the closing tags; the docstring must be valid. +``` + +See the [docstrings documentation](/finishing-touches/docstrings#path-instructions) for more details. + ## April 14, 2025 ### Shopify CLI Integration & Bitbucket Cloud Reporting @@ -30,16 +74,26 @@ Our reporting capabilities now extend to Bitbucket Cloud! You can now: - Track PR review metrics - Deliver reports via Email, Slack, Microsoft Teams, or Discord +## April 11 2025 + +### Agent Chat + +```mdx-code-block + +``` + +We're thrilled to introduce agentic planning on GitHub for CodeRabbit chat as Generally Available for Pro users. This enhancement lets you make more advanced requests that span multiple files. Just add a review or issue comment on any pull request, or issue comment on an issue, issue tagging `@coderabbitai` along with your natural language request for a code change, and the chat will develop a plan for complex modifications. Upon reviewing the plan and getting your consent, CodeRabbit will emit a stacked PR, commit or copyable snippet to your PR or issue for those code changes. + ## April 8, 2025 ### New Static Analysis Tools We've expanded our static analysis capabilities with two new tools: -- **OXC**: A high-performance JavaScript/TypeScript linter written in Rust. +- **Oxlint**: A high-performance JavaScript/TypeScript linter written in Rust. - **Prisma Lint**: A dedicated linter for Prisma schema files to help enforce consistent conventions and best practices. -Both tools can be configured through their respective config files or through CodeRabbit's settings page. See our [tools documentation](https://docs.coderabbit.ai/tools/tools) for more details. +Both tools can be configured through their respective config files or through CodeRabbit's settings page. See our [tools documentation](https://docs.coderabbit.ai/tools/) for more details. ## April 1, 2025 @@ -94,6 +148,10 @@ We're thrilled to introduce agentic planning on GitHub for CodeRabbit chat as an We are continually expanding our support for static analysis tools. We've recently added support for: - SQLFluff +- Added Oxlint for faster linting + - Oxlint is a blazingly fast JavaScript/TypeScript linter written in Rust + - Replaces ESLint for basic linting while maintaining ESLint for more complex rules + - Up to 50-100x faster than traditional ESLint ## February 25, 2025 diff --git a/docs/faq.md b/docs/faq.md index 794ecfc3..f4158154 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -31,10 +31,10 @@ CodeRabbit works with all programming languages, with varying proficiency based - - No persistent code storage - - Temporary cloning during review only - Complete data isolation - - Immediate disposal post-review + - Caching of encrypted code and dependency archives for faster reviews + - Code indexing in which we store vector representations of code for efficient code base context + - Both caching and code indexing can be disabled which means we store nothing post-review - Uses only public datasets @@ -92,7 +92,7 @@ Email field and click Update to save your changes. ### Usage and Configuration - **Language Settings**: Configure review language in repository settings -- **Review Rules**: Customize via [Review Instructions](/guides/review-instructions) +- **Review Rules**: Customize via [review instructions](/guides/review-instructions) - **Branch Selection**: Default branch reviews enabled by default (configurable) ### Access & Permissions @@ -108,7 +108,7 @@ Interact with CodeRabbit by: 1. Replying directly to CodeRabbit comments 2. Tagging `@coderabbitai` in PR discussions 3. Adding review comments for specific lines -4. Customize via [Review Instructions](/guides/review-instructions) +4. Customize via [review instructions](/guides/review-instructions) :::tip Collaboration Mode When team members are active in PRs, use `@coderabbitai` to engage the bot. @@ -128,7 +128,7 @@ The following limits enforced _per developer_: | ---------------- | ------------------------------------------ | ----------------------------- | ----------------------------- | ----------------------------- | | Files per hour | 200/hour | 200/hour | 200/hour | 400/hour | | Files per PR | 100 | 100 | 100 | 200 | -| Reviews per hour | 4 back-to-back, then 3/hour (Summary only) | 4 back-to-back, then 3/hour | 3 back-to-back, then 2/hour | 5 back-to-back, then 4/hour | +| Reviews per hour | 3 back-to-back, then 3/hour (Summary only) | 4 back-to-back, then 4/hour | 3 back-to-back, then 3/hour | 5 back-to-back, then 5/hour | | Chat | N/A | 25 back-to-back, then 50/hour | 10 back-to-back, then 25/hour | 25 back-to-back, then 50/hour | ## Integration Guide {#integration-guide} diff --git a/docs/finishing-touches/docstrings.md b/docs/finishing-touches/docstrings.md index 4de183b5..5d78366e 100644 --- a/docs/finishing-touches/docstrings.md +++ b/docs/finishing-touches/docstrings.md @@ -1,6 +1,5 @@ --- -title: Docstrings generation with CodeRabbit -sidebar_label: Docstrings +title: Generate docstrings description: Automated docstrings pull requests with CodeRabbit --- @@ -33,6 +32,20 @@ CodeRabbit cannot perform further modifications to opened pull requests. From th This feature has been rigorously tested and is now available for all Pro plan users. Additionally, you can provide feedback about this feature on [Discord](https://discord.com/channels/1134356397673414807/1317286905557287022). +## Path Instructions + +You can customize the generated docstrings by providing instructions based on file paths in your `.coderabbit.yaml`. The `path` is a [minimatch](https://github.com/isaacs/minimatch) pattern. + +```yaml +code_generation: + docstrings: + path_instructions: + - path: "**/*.ts" + instructions: | + End all docstrings with a notice that says "Auto-generated by CodeRabbit.". + Do not omit the closing tags; the docstring must be valid. +``` + ## Supported software forges These software forges are supported: diff --git a/docs/getting-started/adding-organizations.md b/docs/getting-started/adding-organizations.md index 81fa8cf6..5f4b635b 100644 --- a/docs/getting-started/adding-organizations.md +++ b/docs/getting-started/adding-organizations.md @@ -1,8 +1,6 @@ --- -title: Adding Organizations +title: Add organizations description: Learn how to add new organizations to CodeRabbit -sidebar_label: Adding Organizations -sidebar_position: 5 --- To add new organizations to CodeRabbit, follow these steps: diff --git a/docs/getting-started/configure-coderabbit.md b/docs/getting-started/configure-coderabbit.md index 09bcb8b3..e8ee2e06 100644 --- a/docs/getting-started/configure-coderabbit.md +++ b/docs/getting-started/configure-coderabbit.md @@ -1,11 +1,9 @@ --- -title: Configure CodeRabbit -sidebar_label: Configure +title: Add a configuration file description: CodeRabbit offers various configuration options to tailor the reviews to your specific requirements. Configuration can be made using one of the below options. -sidebar_position: 2 --- ```mdx-code-block diff --git a/docs/getting-started/quickstart.md b/docs/getting-started/quickstart.md index 280732f0..17cc091c 100644 --- a/docs/getting-started/quickstart.md +++ b/docs/getting-started/quickstart.md @@ -1,55 +1,138 @@ --- -title: Playing with CodeRabbit +title: Quickstart sidebar_label: Quickstart -description: Get started with CodeRabbit in less than 2 minutes +description: See CodeRabbit in action, using a live GitHub repository. sidebar_position: 1 --- -# Quickstart Guide +# Quickstart + +This tutorial gives you a hands-on demonstration of CodeRabbit, using a real, GitHub-based repository. It guides you through the following tasks: + +1. Integrate CodeRabbit into a GitHub-based repository that you own. +1. Observe CodeRabbit perform a code review of a pull request that you initiate. +1. Converse with CodeRabbit about the code review. +1. Prompt CodeRabbit to generate its own improvements to the pull request. + +When you complete this tutorial, you'll have seen CodeRabbit's code-review feature in action, and glimpsed a few of its other AI-driven abilities as well. + +For a more general overview of CodeRabbit, see [Introduction](/). :::note -Get started with CodeRabbit in three simple steps. No complex configuration needed. +While this tutorial focuses on GitHub, CodeRabbit also works with GitLab, Azure DevOps, and Bitbucket. For more information, see [Integrate with Git platforms](/platforms/). ::: -## Steps to Enable CodeRabbit +## Before you begin -### Sign In with GitHub +Create a new, private repository on GitHub. Name the new repository `coderabbit-test`, and let it have otherwise default GitHub settings. -- Visit [coderabbit.ai](https://coderabbit.ai) -- Click "Sign in with GitHub" -- Authorize CodeRabbit +## Integrate CodeRabbit with your GitHub account -![CodeRabbit Login](/img/integrations/login-self-hosted-github.png) +To integrate CodeRabbit with your GitHub account, follow these steps: -### Add Your Repository +1. Visit [the CodeRabbit login page](https://app.coderabbit.ai/login). +1. Click **Login with GitHub**. +1. Click **Authorize coderabbitai**. -- Go to your [Dashboard](https://app.coderabbit.ai/dashboard) -- Click "Add Repositories" -- Select the repositories you want to enable +CodeRabbit takes a moment to set up the integration. After it finishes, the CodeRabbit dashboard appears. -![CodeRabbit Dashboard](/img/getting-started/dashboard-coderabbit.png) +## Add CodeRabbit to your repository -### You're Done ๐ŸŽ‰ +To add CodeRabbit to your test repository, follow these steps: -- CodeRabbit will automatically start reviewing your Pull Requests -- Default configuration works out of the box -- No additional setup needed +1. On the CodeRabbit dashboard, click **Add Repositories**. A GitHub repository-access dialog appears. +1. Select the **Only select repositories** radio button. +1. From the **Select repositories** menu, select the `coderabbit-test` repository that you created earlier in this Quickstart. +1. Click **Install & Authorize**. + :::note + CodeRabbit requests read and write access to your repository in order for its code review, issue management, and pull request generation features to work. CodeRabbit never stores your code. For more information, see [the CodeRabbit Trust Center](https://trust.coderabbit.ai). + ::: +1. If a CodeRabbit **Complete your signup** dialog appears, then fill it out with the requested information before continuing. -## What's Next? +CodeRabbit is now ready to use with your test repository. The next steps demonstrate its core code-review features. -- Watch CodeRabbit -- Here's an example of CodeRabbit in action: - ![CodeRabbit PR Review Example](/img/getting-started/pr-examples.png) -- [View live example PR](https://github.com/tyaga001/devtoolsacademy/pull/39) -- [Configure CodeRabbit](/getting-started/configure-coderabbit) (optional) -- [Add custom review instructions](/guides/review-instructions) (optional) +## Let CodeRabbit perform a code review -## Need Help? +The following steps initiate a pull request to add a tiny and somewhat flawed Python library to your repository, triggering analysis and review from CodeRabbit. -- Join our [Discord community](https://discord.gg/coderabbit) for support -- Check out our [FAQ](/faq) -- Contact [support@coderabbit.ai](mailto:support@coderabbit.ai) +Use your usual Git workflow to perform the following steps in the `coderabbit-test` repository: -:::tip -CodeRabbit starts working immediately. You can customize its behavior later when needed. -::: +1. Create a branch named `add-utils`. + +1. In that new `add-utils` branch, create a new file called `simple_utils.py`, with the following content: + + ```python + # simple_utils.py - A tiny utility library + + def reverse_string(text): + """Reverses the characters in a string.""" + return text[::-1] + + def count_words(sentence): + return len(sentence.split()) + + def celsius_to_fahrenheit(celsius): + return (celsius * 9/5) + 32 + ``` + +1. Commit the added file to the `add-utils` branch. Use any text you want for the commit message. + +1. Create a pull request that proposes to merge the `add-utils` branch into the `main` branch. Use any text you want for the pull request message. + +After a few moments, CodeRabbit responds to the pull request using the `@coderabbitai` GitHub account. It performs the following actions, all of which are visible on the pull request's page on GitHub: + +- If you didn't write a pull request summary, then CodeRabbit adds a new summary to the pull request. +- CodeRabbit posts a comment titled **Walkthrough** containing analysis and commentary about the content of the pull request. +- CodeRabbit attaches a detailed code review to the pull request as another comment. + +Part of the review resembles the following screenshot: + +![An example code review comment](/img/getting-started/quickstart-comment.png) + +This shows that CodeRabbit has noticed some flaws with this Python library, including a lack of docstrings and input validation. The review comment identifies these flaws, and suggests how you might improve them. + +## Ask CodeRabbit for more information + +After CodeRabbit reviews a pull request, you can converse with it about its review. You can also give CodeRabbit special commands to request it to perform specific functions, such as generating appropriate code changes for you. + +1. Post the following as a new GitHub comment attached to the pull request: + + ```text + @coderabbitai Why do all of these functions need docstrings? Isn't it obvious enough what they do? + ``` + + After a few moments, CodeRabbit posts its reply, explaining its motivations for its recommendation. The reply might resemble the following: + + > You're right that these functions are quite self-explanatory from their names alone. Docstrings aren't strictly necessary for every function, especially in smaller projects with clear function names. + > + > While docstrings do provide benefits (IDE tooltips, documentation generation, help for future developers), they can sometimes feel redundant for very straightforward functions. It's ultimately a matter of coding style and project requirements. + > + > If you prefer to skip docstrings for obvious utility functions in this project, that's perfectly reasonable. Would you like me to adjust my review approach regarding documentation for this repository? + + In this case, CodeRabbit is offering to adjust its future behavior when reviewing changes to this repository. Instead, follow the next step to ask CodeRabbit to implement part of its suggestions. + +1. Post the following as another new comment: + + ```text + @coderabbitai generate docstrings + ``` + + After a few moments, CodeRabbit does the following: + + - CodeRabbit creates a new branch, based on `add-utils`. + - CodeRabbit commits changes to the branch that adds suggested docstrings to `add-utils`. + - CodeRabbit opens a new pull request between the new branch and `add-utils`. + +## Clean up + +Continue experimenting with CodeRabbit in your test repository for as long as you like. When you're finished, you can delete the repository. + +You are now ready to add CodeRabbit to other repositories that you own, and let it review some real pull requests. + +## What's next + +- [Integrate CodeRabbit](/platforms/) with your repositories on GitHub, GitLab, Azure DevOps, or Bitbucket. +- [Configure CodeRabbit](/getting-started/configure-coderabbit) beyond its default settings. +- [Add custom review instructions](/guides/review-instructions). +- [Get support for CodeRabbit](/getting-started/support). +- [Learn more about how CodeRabbit works](/overview/why-coderabbit). diff --git a/docs/getting-started/subscription-management.md b/docs/getting-started/subscription-management.md index 31fb9ffe..4483ce78 100644 --- a/docs/getting-started/subscription-management.md +++ b/docs/getting-started/subscription-management.md @@ -1,8 +1,6 @@ --- -title: Subscription Management +title: Manage your subscription description: Learn how to manage your CodeRabbit subscription, including billing, plan changes, and seat management -sidebar_label: Subscription Management -sidebar_position: 7 --- This guide covers how to manage your subscription, including accessing billing information, changing plans, and adjusting your seat count. diff --git a/docs/getting-started/support.md b/docs/getting-started/support.md index 2014965c..9b1ef18b 100644 --- a/docs/getting-started/support.md +++ b/docs/getting-started/support.md @@ -1,8 +1,6 @@ --- -title: Support -sidebar_label: Support +title: Get support description: Get help with CodeRabbit and find answers to common questions. -sidebar_position: 3 --- Welcome to CodeRabbit Support. Please refer to the following sections for diff --git a/docs/getting-started/upgrading-permissions.md b/docs/getting-started/upgrading-permissions.md index 7980bd09..c5553abe 100644 --- a/docs/getting-started/upgrading-permissions.md +++ b/docs/getting-started/upgrading-permissions.md @@ -1,8 +1,6 @@ --- -title: Upgrading App Permissions +title: Set permissions description: Learn how to upgrade CodeRabbit's GitHub App permissions when new features are added -sidebar_label: Upgrading Permissions -sidebar_position: 6 --- Sometimes when we add new features to CodeRabbit, we need to request additional GitHub permissions. If you see a warning about permissions or resources not being accessible, you'll need to approve the new permissions. Here's how to do it: diff --git a/docs/guides/about-vscode.md b/docs/guides/about-vscode.md new file mode 100644 index 00000000..3e484ffe --- /dev/null +++ b/docs/guides/about-vscode.md @@ -0,0 +1,37 @@ +--- +title: Review local changes +description: How to review your code with the VSCode extension. +slug: /code-editors +sidebar_label: Overview +--- + +This page is about the CodeRabbit VSCode extension. For a broader overview of CodeRabbit, see [Introduction](/). + +## About the VSCode extension + +The CodeRabbit VSCode extension lets you apply a limited subset of CodeRabbitโ€™s code-review features to your local development environment, directly from the VSCode IDE. It also works with other text editors that are able to install and use VSCode extensions, such as Cursor and Windsurf. + +You can use the extension on its own, or you can use it to complement your local development on a repository whose remote has CodeRabbit installed. + +The extension is intended to let you use the power of CodeRabbit to rapidly tune and tidy your code changes locally, before you publish your changes to your team's remote repository and start a more thorough code review. + +## Features + +The extension includes the following features: + +- Automatic code reviews on every local Git commit. +- Manually requested reviews of local code changes. +- One-click application of simpler suggested code fixes. +- Integration with AI coding agents, including Copilot and Claude Code, to help you resolve more complex suggestions. +- Full compatibility with text editors derived from VSCode, including Cursor and Windsurf. + +## Price and limitations + +This extension is free to install and use, and works with any tier of CodeRabbit account. Rate limits apply to the number of local reviews that you can request per hour. + +The extension makes only basic CodeRabbit review features available, with default settings applied. Advanced CodeRabbit features, such as interactive chat and project learnings, aren't available through the VSCode extension. These features are available only by [integrating CodeRabbit on your remote repository](/platforms), and then allowing CodeRabbit to review pull requests. + +## What's next + +- [Install the VSCode extension](/guides/install-vscode) +- [Use the VSCode extension](/guides/use-vscode) diff --git a/docs/guides/agent_chat.md b/docs/guides/agent_chat.md index 40847871..4073951a 100644 --- a/docs/guides/agent_chat.md +++ b/docs/guides/agent_chat.md @@ -1,8 +1,6 @@ --- -title: Chat and Agentic Chat -sidebar_label: Chat and Agentic Chat +title: Discuss code reviews with CodeRabbit description: Learn about CodeRabbit Pro's chat and agentic chat system -sidebar_position: 3 --- # CodeRabbit Chat @@ -29,17 +27,19 @@ Upon being invoked, CodeRabbit processes your request and responds with the nece CodeRabbit Chat can automatically generate scripts in various programming languages (mainly shell scripting) to answer questions about your codebase. If incorrect or non-running or non-germane shell scripts are created, CodeRabbit goes and tries again, and the whole script iteration process will be displayed to you in an Analysis Flow. +All scripts are run in a secure sandboxed execution environment. + ### Web Search CodeRabbit Chat integrates real-time web search capabilities, enabling it to fetch up-to-date information to support its responses. The CodeRabbit Chat response will indicate this if it decides to search the web to answer your query. Set `enabled` to false within `web_search` within `knowledge_base` within the config in order to turn this off. -### Code Definition Integration +### Code Graph Analysis Integration -CodeRabbit Chat is capable of taking definitions of code symbols from the symbol graph that CodeRabbit generates from your codebase. The CodeRabbit Chat response will indicate in its responses if it has found relevant symbols and snippets surrounding symbols in your codebase. +CodeRabbit Chat is capable of analyzing definitions of code symbols from the symbol graph it generates from your codebase. CodeRabbit can use these code definitions to enhance context when providing a chat response and review comments. CodeRabbit Chat will indicate in its response if it has found relevant symbols and snippets surrounding those symbols in your codebase. -Set the environment variable `ENABLE_CODE_GRAPH` in self-hosted CodeRabbit instances to turn this feature off. +Set the environment variable `ENABLE_CODE_GRAPH` to false in self-hosted CodeRabbit instances to turn this feature off in self-hosted instances. ### Jira and Linear Integration @@ -65,7 +65,7 @@ Agent chat can be invoked explicitly with the `@coderabbitai plan` command. CodeRabbit cannot perform further modifications to opened pull requests. From there, it's your turn to checkout the branch and improve it to satisfaction. We believe that this workflow provides a significant headstart to implementing code. -Agentic Chat is currently only available on Github issue, pull request and pull request review comments. Agentic Chat is an early access product currently. +Agentic Chat is currently only available on Github issue, pull request and pull request review comments. ### Help and Feedback diff --git a/docs/guides/code-review-best-practices.md b/docs/guides/code-review-best-practices.md new file mode 100644 index 00000000..83bd8abb --- /dev/null +++ b/docs/guides/code-review-best-practices.md @@ -0,0 +1,42 @@ +--- +title: Code review best practices +description: Best practices for managing CodeRabbit code reviews. +sidebar_label: Best practices +--- + +This page lists best practices for performing code reviews with CodeRabbit. + +For more information about working with +CodeRabbit through chat, see [Control and manage code reviews](/guides/commands). + +For a CodeRabbit command reference, see [Code review command reference](/reference/review-commands). + +## Recommended code-review workflow + +- Start with `@coderabbitai review` for checking new changes. +- Use `@coderabbitai full review` when major changes require a fresh perspective. +- Generate summaries after significant updates using `@coderabbitai summary`. + +## Managing large changes + +- Use `@coderabbitai pause` before making multiple commits. +- Resume reviews with `@coderabbitai resume` when ready. +- Consider `@coderabbitai full review` after substantial changes. + +## Documentation flow + +- Run `@coderabbitai generate docstrings` after finalizing function implementations. +- Learn more about [docstring generation](/finishing-touches/docstrings). + +## Overall tips + +- Commands are case-insensitive (`@coderabbitai REVIEW` works the same as `@coderabbitai review`). +- Commands can be issued by anyone with write access to the repository. +- Multiple commands can be used in sequence as needed. +- Use `@coderabbitai configuration` to export your settings before making changes. + +## Command response time + +- Most commands (pause, resume, ignore) take effect immediately. +- Review commands typically complete within a few minutes, depending on PR size. +- Docstring generation time varies based on the number of functions. diff --git a/docs/guides/code-review-overview.md b/docs/guides/code-review-overview.md new file mode 100644 index 00000000..cd511c76 --- /dev/null +++ b/docs/guides/code-review-overview.md @@ -0,0 +1,89 @@ +--- +title: Review pull requests +description: An overview of CodeRabbit's core code review features. +sidebar_label: Overview +--- + +The central feature of CodeRabbit is its ability to proactively review +new pull requests on your code repository. + +CodeRabbit reviews take the form of pull request comments that +include summaries, analyses, and initial critiques of the proposed changes. +This information, usually added to pull requests within minutes, can help your team perform more rapid, better-informed code reviews. + +The following sections present an overview of this feature. For a hands-on example that lets you experience a CodeRabbit code review using +a real repository, see [Quickstart](/getting-started/quickstart). + +## Automatically review pull requests {#review} + +After you [integrate CodeRabbit with your repository](/platforms), CodeRabbit proceeds +to automatically review every subsequent pull request, as soon as each one is created. + +CodeRabbit performs code reviews by attaching comments to the pull request. +These comments contain detailed summaries and analyses of the changes, +as well as listing out problems or areas for potential improvement that it found. + +CodeRabbit uses [a variety of open-source linters and security tools](/tools) and a custom +code verification agent to provide this analysis. CodeRabbit +also consults several models to further analyze and critique the proposed changes, +using all of the content of your repository as context. The code-review comment that CodeRabbit attaches +to your pull request synthesizes and summarizes all of the information collected from these different sources. + +For more information about the graph analysis that CodeRabbit includes with its reviews +when available, see [CodeRabbit Code Graph Analysis](/integrations/code-graph-analysis). + +### Events that trigger automated reviews {#events} + +By default, the following activity in your repository triggers CodeRabbit to +perform a code review: + +- If CodeRabbit sees a new pull request, then it immediately performs a full review + of the proposed code changes. +- If an open pull request that CodeRabbit has already reviewed gets modified with another + commit, then CodeRabbit performs an incremental review that focuses on the new commit. + +## Interact with CodeRabbit reviews {#interact} + +After CodeRabbit attaches its initial code-review comment to a pull request, you can +directly interact with CodeRabbit by mentioning its username, `@coderabbitai`, in comments +that you post to the pull request. + +These interactions can serve several purposes: + +- Free-form discussion about the pull request and the ongoing code review. +- Commands to have CodeRabbit perform specific actions regarding the code review. +- Prompts to have CodeRabbit generate its own improvements to the branch under review. + +### Chat with CodeRabbit {#chat} + +You can have open-ended, natural-language discussion with CodeRabbit during a code review, treating it +as an LLM-powered chatbot that has your entire code repository available for context. For more information, see [CodeRabbit Chat](/guides/agent_chat). + +### Manage CodeRabbit review behavior {#manage} + +CodeRabbit recognizes a variety of keyword-based commands that let you control its +behavior during a code review, including the following: + +- Pause or resume automated reviews of the pull request. +- Manually request a review, when automated reviews are paused. +- Resolve all open comments authored by CodeRabbit. + +For more information, see [Control and manage code reviews](/guides/commands). + +### Generate improvements {#generate} + +You can command CodeRabbit to generate improvements to the branch under review. +CodeRabbit accomplishes this by publishing a new branch based on the branch under review, +and creating a new pull request for your own review. + +Available code-generation commands let you request the following from CodeRabbit: + +- Implement the suggestions for improvements that CodeRabbit has made in its earlier code review comments. +- Generate inline documentation for any undocumented functions that this pull request proposes to add. + +For more information, see [Generate improvements](/guides/generate-improvements). + +## What's next {#whats-next} + +- [Control and manage code reviews](/guides/commands) +- [Generate code improvements](/guides/generate-improvements) diff --git a/docs/guides/code-review-troubleshooting.md b/docs/guides/code-review-troubleshooting.md new file mode 100644 index 00000000..72539453 --- /dev/null +++ b/docs/guides/code-review-troubleshooting.md @@ -0,0 +1,17 @@ +--- +title: Code review troubleshooting +description: Troubleshooting CodeRabbit code reviews. +sidebar_label: Troubleshooting +--- + +This page is about troubleshooting interactive code review sessions with CodeRabbit. For more information about working with +CodeRabbit through chat, see [Control and manage code reviews](/guides/commands). + +If a CodeRabbit command doesn't seem to work: + +1. Check that you have the necessary repository permissions. +2. Verify the command syntax. +3. Look for any response from CodeRabbit in the PR comments. +4. Use `@coderabbitai help` for command guidance. + +Need help? Join our community on [Discord](https://discord.gg/coderabbit) or [contact our support team](/getting-started/support). diff --git a/docs/guides/commands.md b/docs/guides/commands.md index a2a2f70b..43e6283a 100644 --- a/docs/guides/commands.md +++ b/docs/guides/commands.md @@ -1,96 +1,154 @@ --- -title: Commands -sidebar_label: Commands +title: Control and manage code reviews description: Learn how to control CodeRabbit using commands in pull request comments -sidebar_position: 1 --- -# CodeRabbit Commands +This page is about issuing direct commands to CodeRabbit during code reviews. +For a general overview of performing code reviews with CodeRabbit, see [Review pull requests](/guides/code-review-overview). -> Control your code reviews directly from pull request comments using CodeRabbit's command system. Each command starts with `@coderabbitai` followed by the specific action you want to take. +You can control CodeRabbit's behavior with a specific pull request by mentioning the +username of its bot, `@coderabbitai`, alongside keywords in comments or the pull +request description, as specified by the next sections of this page. -## Review Control Commands +For a complete CodeRabbit command reference, see [Code review command reference](/reference/review-commands). -### Managing Reviews +## Control automatic code reviews {#flow} -| Command | Description | Use Case | -| --------------------------- | ---------------------------------------------------- | ---------------------------------------------------------------------------- | -| `@coderabbitai review` | Triggers an incremental review of new changes | When automatic reviews are disabled or you want to manually trigger a review | -| `@coderabbitai full review` | Performs a complete review of all files from scratch | When you want to get fresh insights on the entire PR | -| `@coderabbitai summary` | Regenerates the PR summary | When you want an updated overview after making changes | +By default, CodeRabbit automatically reviews every new pull request created in +your repository. It updates its review with comments whenever the pull request has new commits +pushed to it. -### Review Flow Control +The following sections show you how to tell CodeRabbit to modify this behavior with +a specific pull request, such as pausing reviews, or resolving open comments. -| Command | Description | Use Case | -| ---------------------- | ---------------------------------------- | --------------------------------------------------- | -| `@coderabbitai pause` | Temporarily stops reviews on the PR | When you're making multiple rapid changes | -| `@coderabbitai resume` | Restarts reviews after a pause | When you're ready for CodeRabbit to review again | -| `@coderabbitai ignore` | Permanently disables reviews for this PR | When you want to handle the review process manually | +For more information about permanently configuring the behavior of CodeRabbit on +your repository, see [Add a configuration file](/getting-started/configure-coderabbit). -### Comment Management +### Pause and resume automatic code reviews {#pause-resume} -| Command | Description | Use Case | -| ----------------------- | --------------------------------------- | ------------------------------------------------------- | -| `@coderabbitai resolve` | Resolves all CodeRabbit review comments | When you've addressed all feedback and want to clean up | +You can tell CodeRabbit to pause its automatic reviews of a pull request. If +you do, then you can still manually request CodeRabbit to review changes using +the commands listed on [Code review command reference](/reference/review-commands). -### Documentation Commands +To pause automated reviews of a pull request, post the following comment to the +pull request: -| Command | Description | Use Case | -| ----------------------------------- | -------------------------------------------- | --------------------------------------------------- | -| `@coderabbitai generate docstrings` | Generates docstrings for functions in the PR | When you need automatic documentation for your code | -| `@coderabbitai configuration` | Shows current CodeRabbit settings | When you need to check or export your configuration | +```text +@coderabbitai pause +``` -### Agentic Chat Commands +To resume automated reviews after pausing them, post the following comment to the +pull request: -| Command | Description | Use Case | -| -------------------- | ---------------------------------------------------------- | ---------------------------------------------------- | -| `@coderabbitai plan` | Get the agentic chat to plan an edit for previous comments | When you want CodeRabbit to change your code for you | +```text +@coderabbitai resume +``` -### Help & Support +### Disable automatic code reviews {#ignore} -| Command | Description | Use Case | -| -------------------- | ------------------------------------------ | ------------------------------------------ | -| `@coderabbitai help` | Displays available commands and usage info | When you need guidance on using CodeRabbit | +To disable automatic code reviews for a pull request, add the following line +anywhere in the pull request description: -## Best Practices +```text +@coderabbitai ignore +``` -### Review Workflow +As long as that text remains in the description, CodeRabbit will not +automatically review any commits associated with that pull request. +You can still [chat with CodeRabbit](/guides/agent_chat) and issue other commands in the pull +request comments. -- Start with `@coderabbitai review` for checking new changes -- Use `@coderabbitai full review` when major changes require a fresh perspective -- Generate summaries after significant updates using `@coderabbitai summary` +To enable automatic reviews on that pull request, delete "`@coderabbitai ignore`" +from the pull request description. CodeRabbit commences automatic reviews starting with +the next commit made to the branch under review. -### Managing Large Changes +## Manually request code reviews {#request} -- Use `@coderabbitai pause` before making multiple commits -- Resume reviews with `@coderabbitai resume` when ready -- Consider `@coderabbitai full review` after substantial changes +You can ask CodeRabbit to perform a code review at any time. This can be useful +when you have paused automated code reviews. Manually requested reviews have +two types: -### Documentation Flow +- A _full review_ disregards any comments that CodeRabbit has already made + on this pull request, and generates a complete review of the entire pull request. -- Run `@coderabbitai generate docstrings` after finalizing function implementations -- Learn more about [docstring generation](/finishing-touches/docstrings) +- An _incremental review_ takes all comments that CodeRabbit has made since its most recent full review into consideration, and generates a review of only the new changes. -## Tips +To manually request a full review, post the following comment to the +pull request: -- Commands are case-insensitive (`@coderabbitai REVIEW` works the same as `@coderabbitai review`) -- Commands can be issued by anyone with write access to the repository -- Multiple commands can be used in sequence as needed -- Use `@coderabbitai configuration` to export your settings before making changes +```text +@coderabbitai full review +``` -## Command Response Time +To manually request an incremental review, post the following comment to the +pull request: -- Most commands (pause, resume, ignore) take effect immediately -- Review commands typically complete within a few minutes, depending on PR size -- Docstring generation time varies based on the number of functions +```text +@coderabbitai review +``` -## Troubleshooting +## Resolve comments {#resolve} -If a command doesn't seem to work: +To have CodeRabbit mark all of its previous comments as resolved, post the following comment to the +pull request: -1. Check that you have the necessary repository permissions -2. Verify the command syntax -3. Look for any response from CodeRabbit in the PR comments -4. Use `@coderabbitai help` for command guidance +```text +@coderabbitai resolve +``` -Need help? Join our community on [Discord](https://discord.gg/coderabbit) or contact our support team. +## Update information about the pull request {#update} + +The commands in this section request CodeRabbit to generate and post updated information +about the pull request itself. + +### Update the summary text {#summary} + +To have CodeRabbit update the generated summary of the branchโ€™s proposed changes +to the pull requestโ€™s description, post the following comment: + +```text +@coderabbitai summary +``` + +CodeRabbit updates the summary text to the description under the heading +"Summary by CodeRabbit". + +### Diagram the pull request history {#diagram} + +To have CodeRabbit post a comment that contains a sequence diagram which visualizes the +history of the pull request under review, post the following comment: + +```text +@coderabbitai generate sequence diagram +``` + +## Get information about CodeRabbit {#info} + +The commands in this section request CodeRabbit to display its own configuration +or documentation. + +### Display current configuration {#config} + +To have CodeRabbit post a comment listing out its current configuration +with your repository, post the following comment to the +pull request: + +```text +@coderabbitai configuration +``` + +### Display a quick-reference guide {#help} + +To have CodeRabbit post a comment to the pull request with a quick-reference +guide to its own commands and other features, post the following comment to the +pull request: + +```text +@coderabbitai help +``` + +## What's next {#whats-next} + +- [Generate code improvements](/guides/generate-improvements) +- [Best practices](/guides/code-review-best-practices) +- [Troubleshooting](/guides/code-review-troubleshooting) diff --git a/docs/guides/config-vscode.md b/docs/guides/config-vscode.md new file mode 100644 index 00000000..7a1fb8bd --- /dev/null +++ b/docs/guides/config-vscode.md @@ -0,0 +1,61 @@ +--- +title: Configure the VSCode extension +description: How to configure the CodeRabbit VSCode extension +--- + +This page is about configuring the CodeRabbit VSCode extension. For more information about the extension, see +[Review local changes](/code-editors). + +:::note +The instructions on this page are specific to using the extension with VSCode. If you are instead using a VSCode-compatible editor such as Cursor or Windsurf, then the steps that you need to follow are similar, but might require some adaptation. +::: + +## Find the settings screen {#find} + +To navigate to the settings screen for the CodeRabbit VSCode extension, follow these steps: + +1. In the activity bar, click the Extensions icon. + +1. In the sidebar, under **Installed**, click the gear-shaped **Manage** icon in the CodeRabbit row. + +1. In the menu that appears, select **Settings**. + +The settings screen contains the following configuration controls. + +## Configure AI agent integration {#agent} + +The **Agent Type** setting lets you choose the extension's response to using the **Fix with AI** feature during code reviews. Your options are the following: + +- **Native**: The extension prompts the AI agent associated with your IDE to apply the suggested fix. + + This works only with VSCode, using Copilot. If you have this option selected when using a different IDE, then the extension instead copies the prompt to your clipboard. + +- **Claude Code**: The extension opens the Terminal pane of your IDE and tries to use the `claude` command-line program to apply the suggested fix to your code. You need to have Claude Code installed for this option to be effective. + +- **Clipboard**: The extension copies prompt text describing the suggested fix to your clipboard. From there, you can manually paste the prompt into the coding AI agent that you use with your IDE. + +For more information about the **Fix with AI** feature, see [Request help from your AI coding agent](/guides/use-vscode#agent). + +## Configure automatic review behavior {#auto-reviews} + +The **Auto Review Mode** setting lets you control the behavior of the automatic code reviews that the extension can perform after you make commits to your local Git repository. Your options are the following: + +- **Disabled**: The extension doesn't perform automatic code reviews. + +- **Prompt**: After every commit, the extension displays a dialog asking if you'd like it to perform a code review. + +- **Auto**: The extension always performs a review after every commit. + +For more information about this feature, see [Automatically review local commits](/guides/use-vscode#auto-reviews). + +## Set a review timeout {#timeout} + +The **Review Timeout** setting lets you specify how long the extension waits for a response from CodeRabbit remote servers before timing out a code review. The default value is `20`. + +To turn off timeouts, set this value to `0`. + +## What's next {#whats-next} + +- [Use the VSCode extension](/guides/use-vscode) + +- [Uninstall the VSCode extension](/guides/uninstall-vscode) diff --git a/docs/guides/custom-reports.md b/docs/guides/custom-reports.md index 30655bfb..dbc04280 100644 --- a/docs/guides/custom-reports.md +++ b/docs/guides/custom-reports.md @@ -1,8 +1,6 @@ --- -title: Custom Reports -sidebar_label: Custom Reports +title: Customize reports description: Learn how to create custom reports with CodeRabbit Pro's flexible reporting system -sidebar_position: 8 --- ```mdx-code-block @@ -78,6 +76,11 @@ Contained within the `` tag. - `State`: string ("open"/"closed") - Current state of the PR - `Mergeable`: boolean (true/false) - Whether the PR can be merged - `Is stale`: boolean - Whether PR has been inactive for over 168 hours +- `PR Stage`: string - The current stage of open PRs in Open or Draft state, can be one of: + - "Needs Author Action" - PR requires author attention due to merge conflicts, draft status, or requested changes + - "Waiting for Author to Merge" - PR has approvals and is ready for author to merge + - "Waiting for Code Reviews" - PR is waiting for reviewers to approve + - undefined - PR is not in an open state (is merged or closed) #### Basic Information @@ -126,60 +129,65 @@ Generate a summary of each pull request in the following bullet point format: - If 'Merged: true' set 'PR State: ๐Ÿ”€ Merged' - Else If 'Draft: true' set 'PR State: ๐Ÿ“ Draft' - Else If 'State: open' or 'State: active' set 'PR State: ๐Ÿ’ฌ Open' - - Else If 'State: closed' and 'Merged: false' set 'PR State: ๐Ÿ”’ Closed' + - Else If 'State: closed' or 'State: DECLINED' and 'Merged: false' set 'PR State: ๐Ÿ”’ Closed' - Else set 'PR State: โ“ Unknown' - If the PR is stale, add 'โš ๏ธ Stale' at the end of the PR State. -- Mergeable (if PR State if not 'Merged'): Provide the mergeable status of the PR as 'Mergeable' or 'Not Mergeable'. +- Mergeable (if PR State is not 'Merged'): Provide the mergeable status of the PR as 'Mergeable' or 'Not Mergeable' based on the "Mergeable: " value. +- PR Stage (if PR State is not 'Merged'): Provide the stage of the PR based on the "PR Stage: " value. - Summary: In under 50 words provide a short summary of the PR. - Comments: In under 50 words provide a short summary of all comments found within , including each comments author username from . If there are no comments available, output 'No comments'. - **PR Link:** [#3001](https://github.com/mygithuborg/myrepo/pull/3001) -- **Title:** [PR Title] +- **Title:** PR Title - **PR State:** ๐Ÿ’ฌ Open - **Mergeable:** Mergeable -- **Summary:** [Summary of the PR]. -- **Comments:** [Summary of the PR comments]. +- **PR Stage:** Waiting for Code Reviews +- **Summary:** Summary of the PR. +- **Comments:** Summary of the PR comments or No comments. - **PR Link:** [#302](https://github.com/mygithuborg/thatrepo/pull/302) -- **Title:** [PR Title] +- **Title:** PR Title - **PR State:** ๐Ÿ’ฌ Open - **Mergeable:** Mergeable -- **Summary:** [Summary of the PR]. -- **Comments:** [Summary of the PR comments]. +- **PR Stage:** Waiting for Author to Merge +- **Summary:** Summary of the PR. +- **Comments:** Summary of the PR comments or No comments. - **PR Link:** [#3](https://github.com/mygithuborg/myotherrepo/pull/3) -- **Title:** [PR Title] +- **Title:** PR Title - **PR State:** ๐Ÿ”€ Merged -- **Summary:** [Summary of the PR]. -- **Comments:** [Summary of the PR comments]. +- **Summary:** Summary of the PR. +- **Comments:** Summary of the PR comments or No comments. - **PR Link:** [#14](https://github.com/mygithuborg/frontend/pull/14) -- **Title:** [PR Title] +- **Title:** PR Title - **PR State:** ๐Ÿ’ฌ Open - **Mergeable:** Mergeable -- **Summary:** [Summary of the PR]. -- **Comments:** [Summary of the PR comments]. +- **PR Stage:** Needs Author Action +- **Summary:** Summary of the PR. +- **Comments:** Summary of the PR comments or No comments. - **PR Link:** [#13005](https://github.com/mygithuborg/backend/pull/13005) -- **Title:** [PR Title] +- **Title:** PR Title - **PR State:** ๐Ÿ”€ Merged -- **Summary:** [Summary of the PR]. -- **Comments:** [Summary of the PR comments]. +- **Summary:** Summary of the PR. +- **Comments:** Summary of the PR comments or No comments. - **PR Link:** [#3006](https://github.com/mygithuborg/myrepo/pull/3006) -- **Title:** [PR Title] +- **Title:** PR Title - **PR State:** ๐Ÿ”€ Merged -- **Summary:** [Summary of the PR]. -- **Comments:** [Summary of the PR comments]. +- **Summary:** Summary of the PR. +- **Comments:** Summary of the PR comments or No comments. - **PR Link:** [#3007](https://github.com/mygithuborg/myrepo/pull/3007) -- **Title:** [PR Title] +- **Title:** PR Title - **PR State:** ๐Ÿ“ Draft - **Mergeable:** Not Mergeable -- **Summary:** [Summary of the PR]. -- **Comments:** [Summary of the PR comments]. +- **PR Stage:** Needs Author Action +- **Summary:** Summary of the PR. +- **Comments:** Summary of the PR comments or No comments. ``` diff --git a/docs/guides/generate-improvements.md b/docs/guides/generate-improvements.md new file mode 100644 index 00000000..d194a7dd --- /dev/null +++ b/docs/guides/generate-improvements.md @@ -0,0 +1,102 @@ +--- +title: Generate improvements +description: Request coderabbit to generate its own code improvements during code reviews +--- + +```mdx-code-block +import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; + + +``` + +This page is about using CodeRabbit to generate improvements to code under review. + +For a general overview of performing code reviews with CodeRabbit, see [Review pull requests](/guides/code-review-overview). + +## Overview of CodeRabbit code generation {#overview} + +:::note +This feature is available only on GitHub. +::: + +You can request CodeRabbit to generate improvements to a branch that it is currently reviewing. + +To do this, write out your request prompt in a comment addressed to `@coderabbitai`, +such as with the following examples: + +- `@coderabbitai Please implement the changes you suggested in your code review.` +- `@coderabbitai Add input validation with proper error messages to these new functions.` +- `@coderabbitai Break this large function into smaller, more focused methods.` + +In addition to this kind of free-form request, you can also give CodeRabbit keyword-based +commands for common code-generation requests, as described in [Code generation commands](#commands). +This includes the `plan` keyword, which acts as shorthand for the first prompt on the +previous list. + +After you give it a code-generation prompt or command, CodeRabbit delivers its suggested improvements by taking these steps: + +1. CodeRabbit posts a comment or two to the pull request, detailing its improvement plans. +1. CodeRabbit publishes a new branch, based on the open pull request's branch, to the remote repository. +1. CodeRabbit opens a new pull request based on this new branch, and links to it from the original pull request. + +CodeRabbit doesn't make any further changes to the new branch or to the new pull request +after it creates them. From that point on, it's fully up to you what to do with the new, suggested-change branch. + +The best practice is to effectively take ownership of the new branch for yourself, +deciding whether it's worth merging into the original pull request branch, and making +any further updates you'd like to make first. You can use comments in the new branch +to ask CodeRabbit to explain its changes, if needed, or to otherwise converse with +CodeRabbit about the suggested improvements. + +Because it's just an ordinary Git branch, the presence of the suggested-change branch +doesn't block the ongoing code review in the original pull request branch. You are +free to merge, defer, or close the suggested-change pull request that CodeRabbit made, using any method or timing that fits +your workflow. + +## Code generation commands {#commands} + +This section lists short commands that you can give CodeRabbit to have it accomplish +common code-generation tasks. For more complex tasks, you can instead write out full +prompts, as described in the previous section. + +For a complete CodeRabbit command reference, see [Code review command reference](/reference/review-commands). + +### Generate inline documentation {#docstrings} + +To have CodeRabbit generate missing documentation for function code added by +the pull request, post the following comment to the +pull request: + +```text +@coderabbitai generate docstrings +``` + +For more information about how CodeRabbit can generate inline documentation, including +the Git platforms and programming languages that this feature supports, see +[Docstrings](/finishing-touches/docstrings). + +### Generate solutions to open review comments {#plan} + +To have CodeRabbit generate and add a new repository branch with code improvements +that try to address its own code review comments, post the following comment to the +pull request: + +```text +@coderabbitai plan +``` + +Using this keyword is essentially shorthand for writing out a prompt like the following: + +```text +@coderabbitai Implement the changes that you suggested and apply them to this pull request. +``` + +If you want to give CodeRabbit more specific implement instructions other than a general +request to implement its own suggestions, then you can write out those instructions +as a full prompt, instead of using the one-word `plan` command. + +## What's next {#whats-next} + +- [Control and manage code reviews](/guides/commands) +- [Best practices](/guides/code-review-best-practices) +- [Troubleshooting](/guides/code-review-troubleshooting) diff --git a/docs/guides/install-vscode.md b/docs/guides/install-vscode.md new file mode 100644 index 00000000..ec71e213 --- /dev/null +++ b/docs/guides/install-vscode.md @@ -0,0 +1,55 @@ +--- +title: Install the VSCode extension +description: How to install the CodeRabbit VSCode extension +--- + +This page is about installing the CodeRabbit VSCode extension. For more information about the extension, see +[Review local changes](/code-editors). + +:::note +The instructions on this page are specific to using the extension with VSCode. If you are instead using a VSCode-compatible editor such as Cursor or Windsurf, then the steps that you need to follow are similar, but might require some adaptation. +::: + +## Before you begin + +Before you can use the CodeRabbit VSCode extension, you need a CodeRabbit account. + +If you don't already have an account, you can create one by visiting [the CodeRabbit login page](https://app.coderabbit.ai/login). + +## Install the extension + +To install the CodeRabbit extension, follow these steps: + +1. In the editor activity bar, click **Extensions**. + +1. In sidebar, type `coderabbit` into the **Search Extensions in Marketplace** search bar. After a moment, **CodeRabbit** appears in the sidebar as a search result. + +1. Select **CodeRabbit**. A summary of the CodeRabbit VSCode extension appears in the window's main pane, along with installation controls. + +1. If you would like your editor to automatically check for and apply future updates to the extension, then keep the **Auto Update** checkbox selected. Otherwise, clear the checkbox. + +1. Click **Install**. + +1. A **Log in to CodeRabbit to get started** dialog appears. Click **Login**. If the dialog gets dismissed or times out first, then you can follow these alternate steps: + + 1. Click the CodeRabbit icon in the VSCode activity bar. + + 1. Click the **Use CodeRabbit for Free** button. + +1. Grant VSCode permission to open your browser, if asked. + +1. In your web browser, log into your CodeRabbit account. + +This connects your CodeRabbit account with the CodeRabbit VSCode extension. + +## Install using the marketplace website + +If you are using the VSCode IDE, and not an IDE that derives from it such as Cursor or Windsurf, then you can alternatively obtain and install the CodeRabbit VSCode extension by visiting [the extension's page on the Visual Studio Marketplace](https://coderabbit.link/vscode-docs). + +If you do install the extension this way, then you still need to connect your CodeRabbit account to the extension after installing it, as described in the previous section. + +## What's next + +- [Use the VSCode extension](/guides/use-vscode) + +- [Configure the VSCode extension](/guides/config-vscode) diff --git a/docs/guides/issue-chat.md b/docs/guides/issue-chat.md index a555f2c0..ee4f83a7 100644 --- a/docs/guides/issue-chat.md +++ b/docs/guides/issue-chat.md @@ -1,8 +1,6 @@ --- -title: Issue Chat -sidebar_label: Issue Chat +title: Discuss issues and plan solutions description: Learn how to use CodeRabbit's chat capabilities within issues -sidebar_position: 4 --- ```mdx-code-block @@ -62,6 +60,8 @@ When [agentic thought chain](./agent_chat.md) is enabled, CodeRabbit will use an ![Agentic Thought Chain Example](../../static/img/guides/agentic-thought-chain.png) +All scripts run in the Agentic Thought Chain are run in a secure sandboxed execution environment. + ### Feature Planning Support Issue chat is particularly valuable during feature planning phases: diff --git a/docs/guides/issue-creation.md b/docs/guides/issue-creation.md index 7c461477..f6228b57 100644 --- a/docs/guides/issue-creation.md +++ b/docs/guides/issue-creation.md @@ -1,8 +1,6 @@ --- -title: Issue Creation -sidebar_label: Issue Creation +title: Create issues description: Learn how to create issues directly through CodeRabbit -sidebar_position: 5 --- ```mdx-code-block diff --git a/docs/guides/linked-issues.md b/docs/guides/linked-issues.md index 3528f0a9..b802cb3b 100644 --- a/docs/guides/linked-issues.md +++ b/docs/guides/linked-issues.md @@ -1,8 +1,6 @@ --- -title: Linked Issues -sidebar_label: Linked Issues +title: Work with linked Issues description: Learn how to effectively use linked issues with CodeRabbit for better pull request assessments -sidebar_position: 6 --- # Linked Issues @@ -170,6 +168,6 @@ Only the issue title and description are considered in the assessment. Comments ## Related Resources -- [Review Instructions](./review-instructions.md) +- [Add review instructions](/guides/review-instructions) - [Issue Chat](./issue-chat.md) - [Issue Creation](./issue-creation.md) diff --git a/docs/guides/ondemand-reports.md b/docs/guides/ondemand-reports.md index 471dc04c..41dbe9bb 100644 --- a/docs/guides/ondemand-reports.md +++ b/docs/guides/ondemand-reports.md @@ -1,8 +1,6 @@ --- -title: On-demand Reports -sidebar_label: On-demand Reports +title: Generate reports description: CodeRabbit offers a way to generate on-demand reports using a simple API request -sidebar_position: 9 --- ```mdx-code-block diff --git a/docs/guides/review-instructions.md b/docs/guides/review-instructions.md index fd2b76e8..c44b862c 100644 --- a/docs/guides/review-instructions.md +++ b/docs/guides/review-instructions.md @@ -1,17 +1,15 @@ --- -title: Review Instructions -sidebar_label: Review Instructions +title: Add review instructions description: CodeRabbit offers various customization options to tailor the reviews to your specific requirements. Customizations can be made using one of the below options. -sidebar_position: 2 --- The guide explains how to add custom review instructions for the entire project. Also, see the guide on how to [configure CodeRabbit](/getting-started/configure-coderabbit). -### Path-based instructions {#path-based} +## Path-based instructions {#path-based} This section explains how to add custom code review instructions for the entire project or specific file paths in your project using glob patterns. Developers diff --git a/docs/guides/scheduled-reports.md b/docs/guides/scheduled-reports.md index 8c56b465..44a11f56 100644 --- a/docs/guides/scheduled-reports.md +++ b/docs/guides/scheduled-reports.md @@ -1,8 +1,6 @@ --- -title: Scheduled Reports -sidebar_label: Scheduled Reports +title: Schedule reports description: Learn how to set up automated recurring reports with CodeRabbit Pro -sidebar_position: 7 --- ```mdx-code-block diff --git a/docs/guides/uninstall-vscode.md b/docs/guides/uninstall-vscode.md new file mode 100644 index 00000000..27266d47 --- /dev/null +++ b/docs/guides/uninstall-vscode.md @@ -0,0 +1,25 @@ +--- +title: Uninstall the VSCode extension +description: How to uninstall the CodeRabbit VSCode extension +--- + +This page is about uninstalling the CodeRabbit VSCode extension. For more information about the extension, see +[Review local changes](/code-editors). + +:::note +The instructions on this page are specific to using the extension with VSCode. If you are instead using a VSCode-compatible editor such as Cursor or Windsurf, then the steps that you need to follow are similar, but might require some adaptation. +::: + +## Uninstall the extension + +To uninstall the VSCode extension, follow these steps: + +1. In the VSCode activity bar, click the CodeRabbit icon. + +1. In the CodeRabbit sidebar, click the door-shaped **Logout** icon. + +1. In the VSCode activity bar, click the **Extensions** icon. + +1. In the Extensions sidebar, click the gear-shaped **Manage** icon next to CodeRabbit in the list of installed extensions. + +1. Select **Uninstall**. diff --git a/docs/guides/use-vscode.md b/docs/guides/use-vscode.md new file mode 100644 index 00000000..bfacd87b --- /dev/null +++ b/docs/guides/use-vscode.md @@ -0,0 +1,109 @@ +--- +title: Use the VSCode extension +description: How to review your code with the VSCode extension. +--- + +This page is about performing local code reviews using the CodeRabbit VSCode extension. For more information about the extension, see +[Review local changes](/code-editors). To learn how to install the extension, see [Install the VSCode extension](/guides/install-vscode). + +The CodeRabbit VSCode extension works by comparing changes in your current, checked-out Git branch against another branch in your local repository. You can use the extension to automatically perform full-branch changes after every commit, or make different kinds of comparisons by manually requesting a review. + +:::note +The instructions on this page are specific to using the extension with VSCode. If you are instead using a VSCode-compatible editor such as Cursor or Windsurf, then the steps that you need to follow are similar, but might require some adaptation. +::: + +## Automatically review local commits {#auto-reviews} + +You can let CodeRabbit automatically review commits that you make to your local Git repository. These automatic reviews compare all committed changes against the branch that your working branch is based on. + +To perform an automatic review, follow these steps: + +1. Perform a Git commit using VSCode. After you do this, a dialog appears in your VSCode window, asking **Would you like to start a review?** + +1. Click **Yes**. The CodeRabbit sidebar appears in your VSCode window. + +1. Wait for the review to complete. This might take a few minutes. To cancel a review in progress, click **Stop the review**. + +After the review completes, you can browse and respond to review comments as described in [Work with code reviews](#work). + +You can optionally configure the extension to either always or never perform automatic code reviews on commit, instead of displaying this yes-or-no dialog. For more information, see [Configure automatic review behavior](/guides/config-vscode#auto-reviews). + +For more control of code reviews performed using the CodeRabbit VSCode extension, you can manually request a review, as detailed in the following section. + +## Manually request code reviews {#manual-reviews} + +To manually review changes in a local Git branch using the CodeRabbit VSCode extension, follow these steps: + +1. Click the CodeRabbit icon in the VSCode activity bar. The CodeRabbit sidebar appears. + +1. If you want to compare your code changes to a branch other than its base branch, then follow these steps: + + 1. In the sidebar, under **Branch**, click the name of the base branch. A **Select a base branch** dialog appears, listing other branches in your local Git repository. + + 1. Select the name of a base branch to compare against. + +1. Select one of the review-action options from the menu at the bottom of the CodeRabbit sidebar: + + - To review all changes between the base branch and your current branch, including both committed and uncommitted changes, select **Review all changes**. This is the default selection. + + - To limit the review to only changes on your branch that you have committed, select **Review committed changes**. This includes commits that you have pushed to your remote repository, if any, as well as any local commits. + + - To limit the review to only uncommitted changes on your branch, select **Review uncommitted changes**. This includes both staged and unstaged changes. + +1. Refer to the list of **Files to review** in the sidebar. This list represents all of the files that the selected review action includes. To change this list of files, repeat the previous step to choose a different review action, or use Git features like `git stash` to selectively remove changes. + +1. To perform the review, click the button part of the menu. The CodeRabbit sidebar displays a **Review** section with the review's progress. + +1. Wait for the review to complete. This might take a few minutes. To cancel a review in progress, click **Stop the review**. + +After the review completes, you can browse and respond to review comments as described in the following section. + +## Work with code reviews {#work} + +The CodeRabbit VSCode extension presents code reviews as a series of actionable comments, connected to specific files and lines. It gives you tools to apply its suggestions quickly, when possible. + +### Browse comments {#browse} + +After the extension finishes its review, it adds any comments to the CodeRabbit sidebar under the **Files** heading in the **Reviews** section. + +Each item in **Files** is a comment referring to one or more lines in that file. Click the comment to see a detailed, inline comment in the editor, attached to the appropriate file and lines. + +You can react to these comments however you want: you can apply their advice literally, or let them guide you to find alternate solutions, or ignore them entirely. CodeRabbit comments are metadata stored with VSCode, and are not part of your files. The presence of comments doesn't block your use of version control. + +### Apply suggested changes {#apply} + +Whenever possible, the CodeRabbit VSCode extension attaches discrete change suggestion to comments in the form of code diffs. For example, if it detects a typo in a new function name, the extension might attach a diff with a suggested correction. + +If you agree with CodeRabbit about the suggested fix and want to apply to exactly as it proposes, click the checkmark-shaped **Apply suggested change** icon in the inline comment. The extension makes the change for you in the editor. + +### Request help from your AI coding agent {#agent} + +If CodeRabbit determines that an AI coding agent could help with resolving one of its comments, then it adds a star-shaped **Fix with AI** icon to the inline display of that comment. To have the extension generate a request for an AI agent to address the comment, click this icon. + +Depending upon your IDE and the current extension settings, the extension performs one of the following actions: + +- If you are using VSCode with Copilot installed, then the extension can send the request directly to Copilot. +- If you have Claude Code installed, then the extension can send the request to the `claude` command-line program. +- As a fallback, the extension can copy the request, phrased as an AI prompt, to your clipboard. You can then manually paste this prompt into the coding AI of your IDE. + +For more information about configuring this behavior, see [Configure AI agent integration](/guides/config-vscode#agent). + +### Ignore or collapse comments {#ignore} + +To remove a comment from the editor, click its **Ignore** icon. + +To remove a comment but keep an icon in the editor noting its presence, click its **Collapse** icon. + +To see an ignored or collapsed comment in the editor again, click its summary in the CodeRabbit sidebar. + +### Browse previous reviews {#previous} + +If you have performed reviews prior to the most recent review in the current VSCode window, then you can browse the comments from these reviews under the **Previous reviews** heading in the CodeRabbit sidebar. + +If a past review comment no longer applies to the current state of your code, then clicking that comment won't display a detailed comment or suggestion in the editor. + +## What's next {#whats-next} + +- [Configure the VSCode extension](/guides/config-vscode) + +- [Uninstall the VSCode extension](/guides/uninstall-vscode) diff --git a/docs/integrations/code-graph-analysis.md b/docs/integrations/code-graph-analysis.md index dd0bd582..5958640a 100644 --- a/docs/integrations/code-graph-analysis.md +++ b/docs/integrations/code-graph-analysis.md @@ -1,8 +1,6 @@ --- -title: Code Graph Analysis +title: Analyze your code changes description: Learn about CodeRabbit's intelligent graph-based code analysis. -sidebar_label: Code Graph Analysis -sidebar_position: 6 --- # CodeRabbit Code Graph Analysis diff --git a/docs/integrations/issue-integrations.md b/docs/integrations/issue-integrations.md index a153839b..0ad69f54 100644 --- a/docs/integrations/issue-integrations.md +++ b/docs/integrations/issue-integrations.md @@ -1,8 +1,6 @@ --- -title: Issue Integrations +title: Integrate issue tracking description: Learn about CodeRabbit's integrations with issue tracking systems like Jira and Linear. -sidebar_label: Issue Integrations -sidebar_position: 5 --- CodeRabbit integrates with popular issue tracking systems to provide context from linked and related issues while reviewing code. diff --git a/docs/integrations/knowledge-base.md b/docs/integrations/knowledge-base.md index c15f2f9f..61ff141e 100644 --- a/docs/integrations/knowledge-base.md +++ b/docs/integrations/knowledge-base.md @@ -1,8 +1,6 @@ --- -title: Knowledge Base +title: Apply your code review preferences description: Learn about CodeRabbit's internal knowledge base and its integrations with external services. -sidebar_label: Knowledge Base -sidebar_position: 4 --- CodeRabbit utilizes an internal knowledge base that integrates with several external services to provide a seamless review and issue management experience. diff --git a/docs/overview/introduction.md b/docs/overview/introduction.md index 6f2e2e5b..f937ac67 100644 --- a/docs/overview/introduction.md +++ b/docs/overview/introduction.md @@ -9,56 +9,101 @@ description: slug: "/" --- -## What is CodeRabbit? +# Introduction -> **CodeRabbit** is an AI-powered code reviewer that delivers context-aware feedback on pull requests within minutes, reducing the time and effort needed for manual code reviews. It provides a fresh perspective and catches issues that are often missed, enhancing the overall review quality. +This page provides a conceptual introduction to CodeRabbit. For a hands-on tutorial, see [Quickstart](/getting-started/quickstart/). -Developers can interact directly with the bot within the code, offering additional context, asking questions, or even having the bot generate code. Over time, **CodeRabbit** learns from user input and improves its suggestions. +**CodeRabbit** is an AI-powered code reviewer that delivers context-aware feedback on pull requests within minutes, reducing the time and effort needed for manual code reviews. It complements manual reviews by providing a fresh perspective and catching issues that manual reviews often miss, enhancing the overall review quality. -:::tip -See CodeRabbit in action and watch the demo video below to see how it delivers real-time, context-aware feedback on your pull requests in just a few minutes. -::: +Developers can interact directly with the CodeRabbit bot within their existing Git platform's pull request interface to add context, ask questions, or even have the bot generate code. Over time, CodeRabbit learns from user input and improves its suggestions.
-## Integration with GitHub, GitLab and Azure DevOps +## Core features -> **CodeRabbit** integrates with GitHub, GitLab and Azure DevOps repositories to deliver continuous and incremental reviews for each commit in a pull request (PR) or merge request (MR). Review feedback is automatically sent back to the PR/MR and can be committed directly. +Core CodeRabbit features include the following: -It works via a webhook, monitoring Pull Request (PR) and Merge Request (MR) events. A comprehensive review is performed when a PR or MR is created, and for -incremental commits and comments addressed to the bot. The feedback is then sent directly back to the Pull Request or Merge Request. +- Integrates rapidly with popular Git platforms and workflows. +- Applies dozens of open-source, industry-standard code analyzers to every commit. +- Implements code reviews as familiar pull-request comments. +- Works with contributors through natural-language conversation in comments. +- Learns and adapts to your team's code style and review preferences. +- Provides an observability dashboard of code-contribution activity. +- Practices strong privacy and security, with no retention of analyzed code. +- Offers free use for public repositories, and flexible pricing for private codebases. -![CodeRabbit Code Review Flow showing how AI integrates with GitHub and GitLab for continuous pull request feedback.](/img/about/coderabbit-flow.png "CodeRabbit Code Review Flow") +## Seamless workflow integration -## Data Privacy and Security +CodeRabbit shares its reviews as comments attached to pull requests, using the same Git platform that your team already uses. Further commits in the same pull review prompt CodeRabbit to make further reviews, using the earlier reviews as context. -> **CodeRabbit** does not use data collected from code reviews to train or influence its models. All queries to Large Language Models (LLMs) are ephemeral, with zero retention. No data is shared with third parties. +Each time that it performs a code review, CodeRabbit runs the relevant code changes through [an array of industry-standard code linters, security analyzers, and other tools](/tools/). CodeRabbit synthesizes the output of these tools into its reviews, offering a high-level analysis that can suggest areas for further focus and improvement. -- **Temporary Storage**: Code is temporarily stored in memory during the review process and deleted afterward. -- **Stored Embeddings**: While the code itself isnโ€™t stored, **CodeRabbit** stores embeddings based on chat conversations and workflow systems (Linear, Jira, GitHub/GitLab issues) to improve future reviews. -- **Compliance**: All data is kept confidential, isolated by organization, and complies with **SOC2 Type II** and **GDPR** standards. +Your team can have conversations with CodeRabbit about its reviews by replying to it with follow-up comments on pull requests, asking it questions or making observations about the review using natural language. CodeRabbit continues the conversation appropriately, offering further insights about the code changes, or adjusting its own review style based on feedback. -### Opting Out +### Customizable review preferences -You can opt out of data storage at any time without affecting your access to **CodeRabbit**. -:::warning -However, opting out may reduce the level of personalized review feedback. -::: +As you interact with CodeRabbit through chat, it learns the review preferences of your team, and applies them to all future reviews on a given repository. -## Try CodeRabbit Now +For example, if CodeRabbit uses a linter to suggest that your pull request use four-space indentations, but your team uses a two-space indentation style, then you can reply to CodeRabbit's pull-request comment to tell it exactly that. CodeRabbit acknowledges your feedback and adjusts all of its subsequent reviews with that repository appropriately. -> Ready to experience **CodeRabbit** in action? +For a video introduction to this feature, see [CodeRabbit Learnings](https://www.youtube.com/watch?v=Yu0cmmOYA-U). -:::tip -For open source projects CodeRabbit Pro is **_FREE_**, forever. +If you need to fine-tune CodeRabbit's behavior beyond this, then you can [add a CodeRabbit-specific configuration file](/getting-started/configure-coderabbit) to your repository, or use the CodeRabbit web UI to set further preferences. This file can include [path-based instructions](/guides/review-instructions) for how CodeRabbit should review different files within your codebase. -- No credit card required -- Unlimited public repositories +No matter how you tune and customize CodeRabbit, its default settings make it useful out of the box, able to meaningfully review pull requests within minutes of its introduction to a repository. -::: +### Git platform integration - +CodeRabbit integrates in just a few clicks with many popular Git platforms: + +- GitHub, GitHub Enterprise Cloud, GitHub Enterprise Server, +- GitLab, GitLab Self-Managed +- Azure DevOps +- Bitbucket Cloud + +For more information, see [Supported Git Platforms](/platforms/). + +### Issue-management integration + +You can integrate CodeRabbit with issue-management platforms. This lets you ask CodeRabbit to create tickets during code reviews, or chat with CodeRabbit about your code from within issue comments. Compatible platforms include the following: + +- GitHub Issues +- GitLab Issues +- Jira +- Linear + +For more information, see [Issue Creation](/guides/issue-creation) and [Issue Chat](/guides/issue-chat). + +## Data privacy and security + +CodeRabbit collects only the minimum amount of information needed to provide you with our code review services. Our privacy and security posture centers around protecting your data through ephemerality: + +- All queries to large language models (LLMs) exist in-memory only, with zero retention after each query completes. +- We don't use your code, code reviews, or other collected data to train LLMs. +- CodeRabbit doesn't share any collected customer data with third parties. +- We keep all customer data confidential, and isolated by organization. +- Our data collection and storage practices comply with SOC 2 and GDPR standards. + +For more information about how we protect your data, see [the CodeRabbit Trust Center](https://trust.coderabbit.ai). + +## Flexible pricing, free for public repositories + +Public repositories can use the Pro tier of CodeRabbit at no charge, including all of the code-review features described on this page. Rate limits might apply. + +For private repositories, a number of pricing tiers are available. These range from a Free tier that offers unlimited code-change summaries, to an Enterprise tier with access to advanced features and SLA support. For more information, see [Pricing](https://www.coderabbit.ai/pricing). + +## Review local changes from within VSCode + +As a separate, free product, CodeRabbit offers a VSCode extension that brings a subset of core CodeRabbit features to VSCode. This lets you use the power of CodeRabbit to tune and tidy your code changes locally before pushing your changes into a formal pull request for more thorough reviews. + +For more information, see [Review local changes](/code-editors). + +## What's next + +- [Quickstart](/getting-started/quickstart/) lets you experience your first CodeRabbit code review first-hand. + +- [Review local changes](/code-editors) guides you through installing and using a subset of CodeRabbit features directly from your code editor. + +- [Why CodeRabbit?](/overview/why-coderabbit) dives further into the philosophies and technologies that drive CodeRabbit. diff --git a/docs/platforms/azure-devops.md b/docs/platforms/azure-devops.md index 8e5608c1..12b70765 100644 --- a/docs/platforms/azure-devops.md +++ b/docs/platforms/azure-devops.md @@ -70,7 +70,7 @@ you will need to add the Personal Access Token. management. - **Use the CodeRabbit logo as the profile picture** - This further ensures easy recognition. You can download our logo from - [here](/img/integrations/logo.svg "download"). + [here](/img/integrations/logo.png "download"). ### Key Points to Remember diff --git a/docs/platforms/github-com.md b/docs/platforms/github-com.md index 4866fd00..ecc07272 100644 --- a/docs/platforms/github-com.md +++ b/docs/platforms/github-com.md @@ -109,7 +109,7 @@ CodeRabbit generates detailed statistics and test plans for each pull request. ![Test Plan by CodeRabbit](/img/integrations/test-plan.png) -> CodeRabbit also allows you to configure **custom review instructions** based on your organization's needs, in case you want it to follow specific guidelines beyond the standard review, to learn more on [adding custom review instructions](https://docs.coderabbit.ai/guides/review-instructions/) +> CodeRabbit also allows you to configure **custom review instructions** based on your organization's needs, in case you want it to follow specific guidelines beyond the standard review, to learn more on [adding custom review instructions](/guides/review-instructions) Whether you manage a popular repository or are working on a smaller project, whether it's hosted on **GitLab, GitHub, or self-hosted GitHub or GitLab**, CodeRabbit can help streamline your development process. This AI Code Review assistant is designed to save you time by automating code reviews and offering insightful feedback. diff --git a/docs/platforms/github-enterprise-server.md b/docs/platforms/github-enterprise-server.md index 35f459bb..2e8a6876 100644 --- a/docs/platforms/github-enterprise-server.md +++ b/docs/platforms/github-enterprise-server.md @@ -130,6 +130,8 @@ Keep the following details handy: ![GitHub App Client ID & Secret](/img/integrations/github-app-client-id-secret.png) +We recommend using the CodeRabbit [logo](/img/integrations/logo.png) as the profile picture to ensures easy recognition. + ### **Step 4: CodeRabbit UI Onboarding** Submit the details that were accumulated in previous steps: diff --git a/docs/platforms/platforms.md b/docs/platforms/platforms.md index 8114c500..996089fc 100644 --- a/docs/platforms/platforms.md +++ b/docs/platforms/platforms.md @@ -1,8 +1,6 @@ --- -title: Supported Git Platforms -sidebar_label: Supported Git Platforms +title: Integrate with Git platforms description: Overview of CodeRabbit's supported Git platforms. -sidebar_position: 1 --- CodeRabbit supports various Git platforms to provide code review for your repositories. For the cloud-hosted Git platforms, you can [login][login] to CodeRabbit and add your repositories. The following platforms are supported: diff --git a/docs/platforms/self-hosted-gitlab.md b/docs/platforms/self-hosted-gitlab.md index 4ef7623c..53fae56f 100644 --- a/docs/platforms/self-hosted-gitlab.md +++ b/docs/platforms/self-hosted-gitlab.md @@ -71,6 +71,8 @@ After the user is created, you can retrieve the **User ID** from that user's profile and generate an [**access token**](#generating-personal-access-token). The access token is used to post reviews on merge requests. +We recommend using the CodeRabbit [logo](/img/integrations/logo.png) as the profile picture to ensures easy recognition. + #### **Creating OAuth2 application** For self-managed GitLab, we recommend creating an instance-wide application diff --git a/docs/reference/caching.md b/docs/reference/caching.md new file mode 100644 index 00000000..cea907c0 --- /dev/null +++ b/docs/reference/caching.md @@ -0,0 +1,20 @@ +# Caching + +CodeRabbit provides caching capabilities for code and dependencies to accelerate the review process. This feature enhances your development workflow by delivering faster feedback. + +## Security and Privacy + +- Cached data is encrypted (except for OSS projects) +- Cache expires after a maximum of one week +- Cached data is used exclusively for speeding up reviews + +## Configuration + +You can opt out of caching in two ways: + +1. **Disable Cache**: Configure `Review - Disable Cache` at either: + + - Organization level + - Repository level + +2. **Disable Data Retention**: Turn off the `Data Retention` setting in your Organization Settings to disable all data retention across your organization. diff --git a/docs/reference/review-commands.md b/docs/reference/review-commands.md new file mode 100644 index 00000000..011bf9d5 --- /dev/null +++ b/docs/reference/review-commands.md @@ -0,0 +1,47 @@ +--- +title: Code review commands +description: A list of commands that you can issue to CodeRabbit during code reviews. +--- + +This page lists the various commands that you can issue to CodeRabbit through +its chat interface during code reviews. For more information about working with +CodeRabbit through chat, see [Interact with CodeRabbit reviews](/guides/code-review-overview#interact). + +| Command | Description | Use Case | +| --------------------------- | ---------------------------------------------------- | ---------------------------------------------------------------------------- | +| `@coderabbitai review` | Triggers an incremental review of new changes | When automatic reviews are disabled or you want to manually trigger a review | +| `@coderabbitai full review` | Performs a complete review of all files from scratch | When you want to get fresh insights on the entire PR | +| `@coderabbitai summary` | Regenerates the PR summary | When you want an updated overview after making changes | + +## Code review flow control + +| Command | Description | Use Case | +| ---------------------- | ---------------------------------------- | --------------------------------------------------- | +| `@coderabbitai pause` | Temporarily stops reviews on the PR | When you're making multiple rapid changes | +| `@coderabbitai resume` | Restarts reviews after a pause | When you're ready for CodeRabbit to review again | +| `@coderabbitai ignore` | Permanently disables reviews for this PR | When you want to handle the review process manually | + +## Comment management + +| Command | Description | Use Case | +| ----------------------- | --------------------------------------- | ------------------------------------------------------- | +| `@coderabbitai resolve` | Resolves all CodeRabbit review comments | When you've addressed all feedback and want to clean up | + +## Documentation commands + +| Command | Description | Use Case | +| ----------------------------------- | -------------------------------------------- | --------------------------------------------------- | +| `@coderabbitai generate docstrings` | Generates docstrings for functions in the PR | When you need automatic documentation for your code | +| `@coderabbitai configuration` | Shows current CodeRabbit settings | When you need to check or export your configuration | + +## Agentic chat commands + +| Command | Description | Use Case | +| -------------------- | ---------------------------------------------------------- | ---------------------------------------------------- | +| `@coderabbitai plan` | Get the agentic chat to plan an edit for previous comments | When you want CodeRabbit to change your code for you | + +## Help and support + +| Command | Description | Use Case | +| -------------------- | ------------------------------------------ | ------------------------------------------ | +| `@coderabbitai help` | Displays available commands and usage info | When you need guidance on using CodeRabbit | diff --git a/docs/self-hosted/azure-devops.md b/docs/self-hosted/azure-devops.md index 68b2321b..97137b11 100644 --- a/docs/self-hosted/azure-devops.md +++ b/docs/self-hosted/azure-devops.md @@ -16,6 +16,8 @@ The self-hosted option is only available for CodeRabbit Enterprise customers wit - **Username**: Set the username to "CodeRabbit" for easier identification (optional). - **Profile Image**: Use the CodeRabbitAI logo for the user image (optional). +We recommend using the CodeRabbit [logo](/img/integrations/logo.png) as the profile picture to ensures easy recognition. + ## Add User to Projects Add the CodeRabbit user to each project where you want CodeRabbit to post reviews, with rights to post reviews & open PRs. @@ -62,12 +64,17 @@ LLM_PROVIDER=azure-openai LLM_TIMEOUT=360000 AZURE_OPENAI_ENDPOINT= AZURE_OPENAI_API_KEY= -## it is recommended to use gpt-4o-mini, o3-mini, and o1 deployments. -AZURE_GPT4OMINI_DEPLOYMENT_NAME= -AZURE_O3MINI_DEPLOYMENT_NAME= -AZURE_O1_DEPLOYMENT_NAME= -# optionally, you can swap o3-mini with o1-mini -AZURE_O1MINI_DEPLOYMENT_NAME=[] +## it is recommended to deploy gpt-4.1-mini, o4-mini, o3 deployments, gpt-4.1 (optionally). +AZURE_GPT41MINI_DEPLOYMENT_NAME= +AZURE_O4MINI_DEPLOYMENT_NAME= +AZURE_O3_DEPLOYMENT_NAME= +AZURE_GPT41_DEPLOYMENT_NAME=[] +# optionally, deploy gpt-4o-mini instead of gpt-4.1-mini +AZURE_GPT4OMINI_DEPLOYMENT_NAME=[] +# optionally, deploy o3-mini instead of o4-mini +AZURE_O3MINI_DEPLOYMENT_NAME=[] +# optionally, deploy o1 instead of o3 +AZURE_O1_DEPLOYMENT_NAME=[] # OAuth2 Configuration (optional) # This will use client_credentials flow to get an access token, @@ -105,8 +112,11 @@ AZURE_DEVOPS_BOT_USERNAME= CODERABBIT_LICENSE_KEY= CODERABBIT_API_KEY= -ENABLE_LEARNINGS=[true] ENABLE_METRICS=[true] +ENABLE_LEARNINGS=[true] +# if using CodeRabbit's learnings, also provide the following +# For example, s3://bucket/path/to/database, gs://bucket/path/to/database, etc. +OBJECT_STORE_URI=[] JIRA_HOST=[] JIRA_PAT=[] diff --git a/docs/self-hosted/bitbucket.md b/docs/self-hosted/bitbucket.md index 2512cda4..0adbeed6 100644 --- a/docs/self-hosted/bitbucket.md +++ b/docs/self-hosted/bitbucket.md @@ -16,6 +16,8 @@ The self-hosted option is only available for CodeRabbit Enterprise customers wit - **Username**: Set the username to "CodeRabbit" for easier identification (optional). - **Profile Image**: Use the CodeRabbitAI logo for the user image (optional). +We recommend using the CodeRabbit [logo](/img/integrations/logo.png) as the profile picture to ensures easy recognition. + ## Add User to Projects Add the CodeRabbit user to each project where you want CodeRabbit to post reviews, with permissions to: @@ -54,12 +56,17 @@ LLM_PROVIDER=azure-openai LLM_TIMEOUT=360000 AZURE_OPENAI_ENDPOINT= AZURE_OPENAI_API_KEY= -## it is recommended to use gpt-4o-mini, o3-mini, and o1 deployments. -AZURE_GPT4OMINI_DEPLOYMENT_NAME= -AZURE_O3MINI_DEPLOYMENT_NAME= -AZURE_O1_DEPLOYMENT_NAME= -# optionally, you can swap o3-mini with o1-mini -AZURE_O1MINI_DEPLOYMENT_NAME=[] +## it is recommended to deploy gpt-4.1-mini, o4-mini, o3 deployments, gpt-4.1 (optionally). +AZURE_GPT41MINI_DEPLOYMENT_NAME= +AZURE_O4MINI_DEPLOYMENT_NAME= +AZURE_O3_DEPLOYMENT_NAME= +AZURE_GPT41_DEPLOYMENT_NAME=[] +# optionally, deploy gpt-4o-mini instead of gpt-4.1-mini +AZURE_GPT4OMINI_DEPLOYMENT_NAME=[] +# optionally, deploy o3-mini instead of o4-mini +AZURE_O3MINI_DEPLOYMENT_NAME=[] +# optionally, deploy o1 instead of o3 +AZURE_O1_DEPLOYMENT_NAME=[] # OAuth2 Configuration (optional) # This will use client_credentials flow to get an access token, @@ -100,8 +107,11 @@ BITBUCKET_SERVER_BOT_USERNAME= CODERABBIT_LICENSE_KEY= CODERABBIT_API_KEY= -ENABLE_LEARNINGS=[true] ENABLE_METRICS=[true] +ENABLE_LEARNINGS=[true] +# if using CodeRabbit's learnings, also provide the following +# For example, s3://bucket/path/to/database, gs://bucket/path/to/database, etc. +OBJECT_STORE_URI=[] JIRA_HOST=[] JIRA_PAT=[] diff --git a/docs/self-hosted/github.md b/docs/self-hosted/github.md index cbb14c41..8f7e4962 100644 --- a/docs/self-hosted/github.md +++ b/docs/self-hosted/github.md @@ -42,6 +42,8 @@ Set the following events: - Push - Release +We recommend using the CodeRabbit [logo](/img/integrations/logo.png) as the profile picture to ensures easy recognition. + ## Gather information from the GitHub App - App ID @@ -65,12 +67,17 @@ LLM_PROVIDER=azure-openai LLM_TIMEOUT=360000 AZURE_OPENAI_ENDPOINT= AZURE_OPENAI_API_KEY= -## it is recommended to use gpt-4o-mini, o3-mini, and o1 deployments. -AZURE_GPT4OMINI_DEPLOYMENT_NAME= -AZURE_O3MINI_DEPLOYMENT_NAME= -AZURE_O1_DEPLOYMENT_NAME= -# optionally, you can swap o3-mini with o1-mini -AZURE_O1MINI_DEPLOYMENT_NAME=[] +## it is recommended to deploy gpt-4.1-mini, o4-mini, o3 deployments, gpt-4.1 (optionally). +AZURE_GPT41MINI_DEPLOYMENT_NAME= +AZURE_O4MINI_DEPLOYMENT_NAME= +AZURE_O3_DEPLOYMENT_NAME= +AZURE_GPT41_DEPLOYMENT_NAME=[] +# optionally, deploy gpt-4o-mini instead of gpt-4.1-mini +AZURE_GPT4OMINI_DEPLOYMENT_NAME=[] +# optionally, deploy o3-mini instead of o4-mini +AZURE_O3MINI_DEPLOYMENT_NAME=[] +# optionally, deploy o1 instead of o3 +AZURE_O1_DEPLOYMENT_NAME=[] # OAuth2 Configuration (optional) # This will use client_credentials flow to get an access token, @@ -118,8 +125,11 @@ GITHUB_APP_PEM_FILE= CODERABBIT_LICENSE_KEY= CODERABBIT_API_KEY= -ENABLE_LEARNINGS=[true] ENABLE_METRICS=[true] +ENABLE_LEARNINGS=[true] +# if using CodeRabbit's learnings, also provide the following +# For example, s3://bucket/path/to/database, gs://bucket/path/to/database, etc. +OBJECT_STORE_URI=[] JIRA_HOST=[] JIRA_PAT=[] diff --git a/docs/self-hosted/gitlab.md b/docs/self-hosted/gitlab.md index e1203036..42736e2f 100644 --- a/docs/self-hosted/gitlab.md +++ b/docs/self-hosted/gitlab.md @@ -16,6 +16,8 @@ The self-hosted option is only available for CodeRabbit Enterprise customers wit - **Username**: Set the username to "CodeRabbit" for easier identification (optional). - **Profile Image**: Use the CodeRabbitAI logo for the user image (optional). +We recommend using the CodeRabbit [logo](/img/integrations/logo.png) as the profile picture to ensures easy recognition. + ## Add User to Projects Add the CodeRabbit user to each project where you want CodeRabbit to post reviews, with at least `Developer` access. @@ -60,12 +62,17 @@ LLM_PROVIDER=azure-openai LLM_TIMEOUT=360000 AZURE_OPENAI_ENDPOINT= AZURE_OPENAI_API_KEY= -## it is recommended to use gpt-4o-mini, o3-mini, and o1 deployments. -AZURE_GPT4OMINI_DEPLOYMENT_NAME= -AZURE_O3MINI_DEPLOYMENT_NAME= -AZURE_O1_DEPLOYMENT_NAME= -# optionally, you can swap o3-mini with o1-mini -AZURE_O1MINI_DEPLOYMENT_NAME=[] +## it is recommended to deploy gpt-4.1-mini, o4-mini, o3 deployments, gpt-4.1 (optionally). +AZURE_GPT41MINI_DEPLOYMENT_NAME= +AZURE_O4MINI_DEPLOYMENT_NAME= +AZURE_O3_DEPLOYMENT_NAME= +AZURE_GPT41_DEPLOYMENT_NAME=[] +# optionally, deploy gpt-4o-mini instead of gpt-4.1-mini +AZURE_GPT4OMINI_DEPLOYMENT_NAME=[] +# optionally, deploy o3-mini instead of o4-mini +AZURE_O3MINI_DEPLOYMENT_NAME=[] +# optionally, deploy o1 instead of o3 +AZURE_O1_DEPLOYMENT_NAME=[] # OAuth2 Configuration (optional) # This will use client_credentials flow to get an access token, @@ -109,8 +116,11 @@ GITLAB_WEBHOOK_SECRET= CODERABBIT_LICENSE_KEY= CODERABBIT_API_KEY= -ENABLE_LEARNINGS=[true] ENABLE_METRICS=[true] +ENABLE_LEARNINGS=[true] +# if using CodeRabbit's learnings, also provide the following +# For example, s3://bucket/path/to/database, gs://bucket/path/to/database, etc. +OBJECT_STORE_URI=[] JIRA_HOST=[] JIRA_PAT=[] diff --git a/docs/tools/list.md b/docs/tools/list.md new file mode 100644 index 00000000..d85b4c78 --- /dev/null +++ b/docs/tools/list.md @@ -0,0 +1,76 @@ +--- +title: List of supported tools +description: Overview of CodeRabbit's supported linters and security analysis tools +--- + +This is a list of the third-party open-source linters and security analysis tools that CodeRabbit uses to generate code reviews. + +For more information about fine-tuning the CodeRabbit configuration of a tool, click that tool's name in the following list. + +For an overview of how CodeRabbit uses these tools when generating code reviews, as well as general information about controlling their use, see [Configure third-party tools](/tools/). + +| Technology | Tools | Category | +| :-------------------------- | :--------------------------------------------------------- | :-------------------------------------------------- | +| All | [Gitleaks][Gitleaks], [Pipeline Remediation][Pipeline] | Code Security, CI/CD | +| Azure DevOps Pipelines | [Pipeline Remediation][Pipeline] | CI/CD Failure Remediation | +| CircleCI | [CircleCI][CircleCI], [Pipeline Remediation][Pipeline] | Configuration Validation, CI/CD Failure Remediation | +| CloudFormation | [Checkov][Checkov] | Code Security | +| Cppcheck | [Cppcheck][Cppcheck] | Code Quality | +| CSS | [Biome][Biome] | Code Quality | +| Docker | [Hadolint][Hadolint], [Checkov][Checkov] | Code Quality, Code Security | +| GitHub Actions | [actionlint][actionlint], [Pipeline Remediation][Pipeline] | Code Quality, CI/CD Failure Remediation | +| GitLab Pipelines | [Pipeline Remediation][Pipeline] | CI/CD Failure Remediation | +| Go | [golangci-lint][golangci-lint] | Code Quality | +| Helm | [Checkov][Checkov] | Code Security | +| Javascript | [Biome][Biome], [oxlint][oxlint] | Code Quality | +| JSON, JSONC | [Biome][Biome] | Code Quality | +| JSX | [Biome][Biome], [oxlint][oxlint] | Code Quality | +| Kotlin | [detekt][detekt] | Code Quality | +| Kubernetes | [Checkov][Checkov] | Code Security | +| Lua | [Luacheck][Luacheck] | Code Quality | +| Markdown | [markdownlint][markdownlint], [LanguageTool][LanguageTool] | Code Quality, Grammar Checking | +| PHP | [PHPStan][PHPStan] | Code Quality | +| Plaintext | [LanguageTool][LanguageTool] | Grammar and Spell Checking | +| Java | [PMD][PMD] | Code Quality | +| Protobuf | [Buf][Buf] | Code Quality | +| Python | [Ruff][Ruff] | Code Quality | +| Regal | [Regal][Regal] | Code Quality | +| Ruby | [RuboCop][RuboCop] | Code Quality | +| Semgrep | [Semgrep][Semgrep] | Code Security | +| Shell (sh, bash, ksh, dash) | [ShellCheck][ShellCheck] | Code Quality | +| Shopify | [Shopify CLI][ShopifyCLI] | Code Quality | +| SQL | [SQLFluff][SQLFluff] | Code Quality | +| Swift | [SwiftLint][SwiftLint] | Code Quality | +| Terraform | [Checkov][Checkov] | Code Security | +| TSX | [Biome][Biome], [oxlint][oxlint] | Code Quality | +| Typescript | [Biome][Biome], [oxlint][oxlint] | Code Quality | +| YAML | [YAMLlint][YAMLlint] | Code Quality | +| Prisma | [Prisma Lint][PrismaLint] | Code Quality | + +[ShellCheck]: /tools/shellcheck.md +[SQLFluff]: /tools/sqlfluff.md +[Ruff]: /tools/ruff.md +[markdownlint]: /tools/markdownlint.md +[LanguageTool]: /tools/languagetool.md +[Biome]: /tools/biome.md +[Hadolint]: /tools/hadolint.md +[SwiftLint]: /tools/swiftlint.md +[PHPStan]: /tools/phpstan.md +[golangci-lint]: /tools/golangci-lint.md +[YAMLlint]: /tools/yamllint.md +[Gitleaks]: /tools/gitleaks.md +[Checkov]: /tools/checkov.md +[detekt]: /tools/detekt.md +[RuboCop]: /tools/rubocop.md +[Buf]: /tools/buf.md +[actionlint]: /tools/actionlint.md +[Regal]: /tools/regal.md +[PMD]: /tools/pmd.md +[Cppcheck]: /tools/cppcheck.md +[CircleCI]: /tools/circleci.md +[Semgrep]: /tools/semgrep.md +[Pipeline]: /tools/pipeline-remediation.md +[PrismaLint]: /tools/prisma-lint.md +[oxlint]: /tools/oxlint.md +[ShopifyCLI]: /tools/shopify-cli.md +[Luacheck]: /tools/luacheck.md diff --git a/docs/tools/luacheck.md b/docs/tools/luacheck.md new file mode 100644 index 00000000..3a8414b6 --- /dev/null +++ b/docs/tools/luacheck.md @@ -0,0 +1,49 @@ +--- +title: Luacheck +sidebar_label: Luacheck +description: CodeRabbit's guide to Luacheck. +--- + +```mdx-code-block +import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; + + +``` + +[Luacheck](https://github.com/mpeterv/luacheck) is a static analyzer and linter for Lua code that detects various issues such as undefined global variables, unused variables and values, accessing uninitialized variables, unreachable code, and more. + +## Supported Files + +Luacheck will run on files with the following extensions: + +- `.lua` + +## Configuration + +Luacheck supports the following configuration files: + +- `.luacheckrc` +- `luacheckrc` +- `.luacheckrc.lua` +- `luacheckrc.lua` + +:::note + +Luacheck does not require configuration to run. If no configuration file is found, it will use default settings. + +::: + +## Features + +Luacheck can detect: + +- Usage of undefined global variables +- Unused variables and values +- Accessing uninitialized variables +- Unreachable code +- And many more issues + +## Links + +- [Luacheck GitHub Repository](https://github.com/mpeterv/luacheck) +- [Luacheck Documentation](https://luacheck.readthedocs.io/) diff --git a/docs/tools/oxc.md b/docs/tools/oxc.md deleted file mode 100644 index ac01dfe0..00000000 --- a/docs/tools/oxc.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: OXC -sidebar_label: OXC -description: CodeRabbit's guide to OXC (Oxidation Compiler). ---- - -```mdx-code-block -import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; - - -``` - -[OXC](https://github.com/oxc-project/oxc) is a collection of high-performance JavaScript/TypeScript tools written in Rust, including a linter that is 50-100x faster than ESLint. - -## Files - -OXC will run on files with the following extensions: - -- `.js` -- `.jsx` -- `.ts` -- `.tsx` - -## Configuration - -OXC supports the following config files: - -- `oxlint.json` -- `.oxlintrc` -- `.oxlintrc.json` -- `oxlint.config.json` - -:::note - -OXC does not require configuration to run. If no OXC config file is found and Biome is enabled, CodeRabbit will use Biome instead as OXC functionality is included within Biome. If Biome is not enabled or an OXC config file is found, CodeRabbit will use the default OXC config. - -::: - -## Rule Configuration - -While OXC embraces convention over configuration, you can customize rules in your config file if needed. The config file should be in JSON format. See the [OXC documentation](https://oxc-project.github.io) for more details on available rules and configuration options. - -## Links - -- [OXC GitHub Repository](https://github.com/oxc-project/oxc) -- [OXC Website](https://oxc.rust-server.org) diff --git a/docs/tools/oxlint.md b/docs/tools/oxlint.md new file mode 100644 index 00000000..fd5e7e2c --- /dev/null +++ b/docs/tools/oxlint.md @@ -0,0 +1,50 @@ +--- +title: Oxlint +sidebar_label: Oxlint +description: CodeRabbit's guide to Oxlint. +--- + +```mdx-code-block +import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; + + +``` + +[Oxlint](https://oxc.rs/docs/guide/usage/linter) is a blazingly fast JavaScript/TypeScript linter written in Rust that is 50-100x faster than ESLint. + +## Supported Files + +Oxlint will run on files with the following extensions: + +- `.js` +- `.mjs` +- `.cjs` +- `.jsx` +- `.ts` +- `.mts` +- `.cts` +- `.tsx` +- `.vue` +- `.astro` +- `.svelte` + +## Configuration + +Oxlint supports the following configuration file: + +- `.oxlintrc.json` + +:::note + +If no Oxlint config file is found and Biome is enabled, CodeRabbit will use Biome instead as Oxlint functionality is included within Biome. + +If Biome is not enabled or an Oxlint config file is found, CodeRabbit will use the `.oxlintrc.json` Oxlint config to run. + +Oxlint does not require configuration to run if Biome is disabled and Oxlint is enabled. + +::: + +## Links + +- [Oxlint GitHub Repository](https://github.com/oxc-project/oxc/releases/) +- [Oxlint Website](https://oxc.rs/docs/guide/usage/linter) diff --git a/docs/tools/pipeline-remediation.md b/docs/tools/pipeline-remediation.md index d03ad33d..2beb0213 100644 --- a/docs/tools/pipeline-remediation.md +++ b/docs/tools/pipeline-remediation.md @@ -94,7 +94,7 @@ With CodeRabbit CI/CD Pipeline Remediation, you have coderabbit automatically re ### GitLab CI/CD -- Pipeline failure analysis +- GitLab CI/CD Pipeline failure analysis - Integration with GitLab Advanced Security - Support for DAST (Dynamic Application Security Testing) findings - Remediation for SAST (Static Application Security Testing) issues @@ -105,16 +105,16 @@ With CodeRabbit CI/CD Pipeline Remediation, you have coderabbit automatically re ### CircleCI -- Workflow failure detection +- CircleCI Pipeline failure analysis - Job-level error analysis - Configuration validation - Dependency resolution CircleCI Integration -### Azure DevOps +### Azure DevOps Pipelines -- Pipeline failure detection +- Azure DevOps CI/CD Pipeline failure analysis - Integration with Azure DevOps Checks - Support for custom tasks and pipelines - Remediation for build issues @@ -174,4 +174,4 @@ Our tool handles a wide range of pipeline failures including: - [GitHub Actions Configuration](https://docs.github.com/en/actions) - [GitLab CI/CD Documentation](https://docs.gitlab.com/ee/ci/) - [CircleCI Documentation](https://circleci.com/docs/) -- [Azure DevOps Documentation](https://learn.microsoft.com/en-us/azure/devops/pipelines/get-started/pipelines-get-started?view=azure-devops) +- [Azure DevOps Pipeline Documentation](https://learn.microsoft.com/en-us/azure/devops/pipelines/get-started/pipelines-get-started?view=azure-devops) diff --git a/docs/tools/tools.md b/docs/tools/tools.md index c21a1225..45b376c5 100644 --- a/docs/tools/tools.md +++ b/docs/tools/tools.md @@ -1,10 +1,10 @@ --- -title: Supported Tools -sidebar_label: Supported Tools +title: Configure third-party tool use description: Overview of CodeRabbit's supported linters and security analysis tools. -sidebar_position: 1 --- +This page provides an overview of how CodeRabbit uses third-party open-source tools to deliver its multifaceted code reviews. For a complete list of supported tools, see [Supported tools](/tools/list). + ```mdx-code-block import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; @@ -13,6 +13,8 @@ import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; CodeRabbit supports various linters and security analysis tools to improve the code review process. The output of these tools is used to enhance the feedback provided by CodeRabbit, making it possible to provide 1-click fixes for common issues. +All tool runs are done in a secure sandboxed execution environment. + ## Enabling/Disabling Tools You can enable or disable tools by setting `reviews.tools..enabled` in your project's `.coderabbit.yaml` file or setting the "Review โ†’ Tools โ†’ Tool โ†’ Enabled" field in CodeRabbit's settings page. @@ -40,68 +42,6 @@ Remove extraneous f prefix (F541) ``` -## Supported Tools - -| Technology | Tools | Category | -| :-------------------------- | :--------------------------------------------------------- | :-------------------------------------------------- | -| All | [Gitleaks][Gitleaks], [Pipeline Remediation][Pipeline] | Code Security, CI/CD | -| Azure DevOps Pipelines | [Pipeline Remediation][Pipeline] | CI/CD Failure Remediation | -| CircleCI | [CircleCI][CircleCI], [Pipeline Remediation][Pipeline] | Configuration Validation, CI/CD Failure Remediation | -| CloudFormation | [Checkov][Checkov] | Code Security | -| Cppcheck | [Cppcheck][Cppcheck] | Code Quality | -| CSS | [Biome][Biome] | Code Quality | -| Docker | [Hadolint][Hadolint], [Checkov][Checkov] | Code Quality, Code Security | -| GitHub Actions | [actionlint][actionlint], [Pipeline Remediation][Pipeline] | Code Quality, CI/CD Failure Remediation | -| GitLab Pipelines | [Pipeline Remediation][Pipeline] | CI/CD Failure Remediation | -| Go | [golangci-lint][golangci-lint] | Code Quality | -| Helm | [Checkov][Checkov] | Code Security | -| Javascript | [Biome][Biome], [OXC][OXC] | Code Quality | -| JSON, JSONC | [Biome][Biome] | Code Quality | -| JSX | [Biome][Biome], [OXC][OXC] | Code Quality | -| Kotlin | [detekt][detekt] | Code Quality | -| Kubernetes | [Checkov][Checkov] | Code Security | -| Markdown | [markdownlint][markdownlint], [LanguageTool][LanguageTool] | Code Quality, Grammar Checking | -| PHP | [PHPStan][PHPStan] | Code Quality | -| Plaintext | [LanguageTool][LanguageTool] | Grammar and Spell Checking | -| Java | [PMD][PMD] | Code Quality | -| Protobuf | [Buf][Buf] | Code Quality | -| Python | [Ruff][Ruff] | Code Quality | -| Regal | [Regal][Regal] | Code Quality | -| Ruby | [RuboCop][RuboCop] | Code Quality | -| Semgrep | [Semgrep][Semgrep] | Code Security | -| Shell (sh, bash, ksh, dash) | [ShellCheck][ShellCheck] | Code Quality | -| Shopify | [Shopify CLI][ShopifyCLI] | Code Quality | -| SQL | [SQLFluff][SQLFluff] | Code Quality | -| Swift | [SwiftLint][SwiftLint] | Code Quality | -| Terraform | [Checkov][Checkov] | Code Security | -| TSX | [Biome][Biome], [OXC][OXC] | Code Quality | -| Typescript | [Biome][Biome], [OXC][OXC] | Code Quality | -| YAML | [YAMLlint][YAMLlint] | Code Quality | -| Prisma | [Prisma Lint][PrismaLint] | Code Quality | - -[ShellCheck]: ./shellcheck.md -[SQLFluff]: ./sqlfluff.md -[Ruff]: ./ruff.md -[markdownlint]: ./markdownlint.md -[LanguageTool]: ./languagetool.md -[Biome]: ./biome.md -[Hadolint]: ./hadolint.md -[SwiftLint]: ./swiftlint.md -[PHPStan]: ./phpstan.md -[golangci-lint]: ./golangci-lint.md -[YAMLlint]: ./yamllint.md -[Gitleaks]: ./gitleaks.md -[Checkov]: ./checkov.md -[detekt]: ./detekt.md -[RuboCop]: ./rubocop.md -[Buf]: ./buf.md -[actionlint]: ./actionlint.md -[Regal]: ./regal.md -[PMD]: ./pmd.md -[Cppcheck]: ./cppcheck.md -[CircleCI]: ./circleci.md -[Semgrep]: ./semgrep.md -[Pipeline]: ./pipeline-remediation.md -[PrismaLint]: ./prisma-lint.md -[OXC]: ./oxc.md -[ShopifyCLI]: ./shopify-cli.md +## What's next + +- For a complete list of tools that CodeRabbit supports, see [Supported tools](/tools/list). diff --git a/sidebars.ts b/sidebars.ts index 5f41290e..210e385d 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -29,13 +29,173 @@ import type { SidebarsConfig } from "@docusaurus/plugin-content-docs" const sidebars: SidebarsConfig = { docsSidebar: [ { - type: "autogenerated", - dirName: ".", + type: "category", + collapsed: true, + label: "Get started with CodeRabbit", + items: ["overview/introduction", "getting-started/quickstart"], }, { - type: "link", - label: "API Reference", - href: "https://api.coderabbit.ai/api/swagger/", + type: "category", + collapsed: true, + label: "Add CodeRabbit to your repository", + items: [ + "platforms/platforms", + { + type: "category", + collapsed: true, + label: "Supported Git platforms", + items: [ + "platforms/github-com", + "platforms/github-enterprise-server", + "platforms/gitlab-com", + "platforms/self-hosted-gitlab", + "platforms/azure-devops", + "platforms/bitbucket-cloud", + ], + }, + "getting-started/adding-organizations", + "getting-started/upgrading-permissions", + { + type: "category", + collapsed: true, + label: "Self-host CodeRabbit", + items: [ + "self-hosted/github", + "self-hosted/gitlab", + "self-hosted/azure-devops", + "self-hosted/bitbucket", + ], + }, + ], + }, + { + type: "category", + collapsed: true, + label: "Configure CodeRabbit", + items: [ + "getting-started/configure-coderabbit", + "integrations/knowledge-base", + "guides/review-instructions", + "tools/tools", + ], + }, + { + type: "category", + collapsed: true, + label: "Review pull requests", + items: [ + "guides/code-review-overview", + "guides/commands", + "guides/generate-improvements", + "guides/code-review-best-practices", + "guides/code-review-troubleshooting", + "guides/agent_chat", + { + type: "category", + collapsed: true, + label: "Analyze and improve your code", + items: [ + "integrations/code-graph-analysis", + "finishing-touches/docstrings", + ], + }, + ], + }, + { + type: "category", + collapsed: true, + label: "Create and resolve issues", + items: [ + "integrations/issue-integrations", + "guides/issue-chat", + "guides/issue-creation", + "guides/linked-issues", + ], + }, + { + type: "category", + collapsed: true, + label: "Review local changes", + items: [ + "guides/about-vscode", + "guides/install-vscode", + "guides/use-vscode", + "guides/config-vscode", + "guides/uninstall-vscode", + ], + }, + { + type: "category", + collapsed: true, + label: "Generate reports", + items: [ + "guides/ondemand-reports", + "guides/custom-reports", + "guides/scheduled-reports", + ], + }, + { + type: "category", + collapsed: true, + label: "Reference", + items: [ + { + type: "link", + label: "CodeRabbit API", + href: "https://api.coderabbit.ai/api/swagger/", + }, + "reference/review-commands", + { + type: "category", + label: "Supported tools", + collapsed: true, + items: [ + "tools/list", + "tools/actionlint", + "tools/biome", + "tools/buf", + "tools/checkov", + "tools/circleci", + "tools/cppcheck", + "tools/detekt", + "tools/eslint", + "tools/gitleaks", + "tools/golangci-lint", + "tools/hadolint", + "tools/languagetool", + "tools/luacheck", + "tools/markdownlint", + "tools/oxlint", + "tools/phpstan", + "tools/pipeline-remediation", + "tools/pmd", + "tools/prisma-lint", + "tools/regal", + "tools/rubocop", + "tools/ruff", + "tools/semgrep", + "tools/shellcheck", + "tools/sqlfluff", + "tools/swiftlint", + "tools/yamllint", + ], + }, + "reference/caching", + ], + }, + { + type: "category", + collapsed: true, + label: "Resources", + items: [ + "getting-started/support", + "getting-started/subscription-management", + "overview/why-coderabbit", + "faq", + "early-access", + "future-development", + "changelog", + ], }, ], } diff --git a/static/img/getting-started/quickstart-comment.png b/static/img/getting-started/quickstart-comment.png new file mode 100644 index 00000000..9813172b Binary files /dev/null and b/static/img/getting-started/quickstart-comment.png differ diff --git a/static/img/integrations/logo.png b/static/img/integrations/logo.png new file mode 100644 index 00000000..18eb4911 Binary files /dev/null and b/static/img/integrations/logo.png differ diff --git a/static/schema/schema.v2.json b/static/schema/schema.v2.json index 2d0055b9..66ccd0a5 100644 --- a/static/schema/schema.v2.json +++ b/static/schema/schema.v2.json @@ -82,6 +82,8 @@ "zh", "crh-UA", "crh", + "cs-CZ", + "cs", "nb", "no", "nl-NL", @@ -91,7 +93,9 @@ "fa-IR", "sv-SE", "de-LU", - "fr-FR" + "fr-FR", + "bg-BG", + "bg" ], "default": "en-US", "description": "Set the language for reviews by using the corresponding ISO language code." @@ -112,11 +116,6 @@ "default": true, "description": "Enable free tier features for users not on a paid plan." }, - "auto_resolve_threads": { - "type": "boolean", - "default": true, - "description": "Automatically resolve threads when code changes address the feedback. When disabled, metrics are still tracked but threads won't be marked as resolved." - }, "reviews": { "type": "object", "properties": { @@ -281,6 +280,11 @@ "default": true, "description": "Abort the in-progress review if the pull request is closed or merged." }, + "disable_cache": { + "type": "boolean", + "default": false, + "description": "Disable caching of code and dependencies. This will force CodeRabbit to download the code and dependencies fresh from the repository each time." + }, "auto_review": { "type": "object", "properties": { @@ -342,6 +346,19 @@ "additionalProperties": false, "default": {}, "description": "Docstrings | Options for generating Docstrings for your PRs/MRs." + }, + "unit_tests": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": true, + "description": "Unit Tests | Allow CodeRabbit to generate unit tests for PRs/MRs." + } + }, + "additionalProperties": false, + "default": {}, + "description": "Unit Tests | Options for generating unit tests for your PRs/MRs." } }, "additionalProperties": false, @@ -385,7 +402,7 @@ }, "additionalProperties": false, "default": {}, - "description": "Enable ast-grep | ast-grep is a code analysis tool that helps you to find patterns in your codebase using abstract syntax trees patterns. | v0.31.1" + "description": "Enable ast-grep | ast-grep is a code analysis tool that helps you to find patterns in your codebase using abstract syntax trees patterns. | v0.38.1" }, "shellcheck": { "type": "object", @@ -406,7 +423,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable Ruff | Ruff is a Python linter and code formatter. | Enable Ruff integration. | v0.8.2" + "description": "Enable Ruff | Ruff is a Python linter and code formatter. | Enable Ruff integration. | v0.11.9" } }, "additionalProperties": false, @@ -436,7 +453,7 @@ }, "timeout_ms": { "type": "number", - "maximum": 300000, + "maximum": 900000, "minimum": 0, "default": 90000, "description": "Time in milliseconds to wait for all GitHub Checks to conclude." @@ -551,7 +568,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "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. | v2.0.3" + "description": "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. | v2.1.15" }, "level": { "type": "string", @@ -600,7 +617,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable YAMLlint | YAMLlint is a linter for YAML files. | Enable YAMLlint integration. | v1.35.1" + "description": "Enable YAMLlint | YAMLlint is a linter for YAML files. | Enable YAMLlint integration. | v1.37.1" } }, "additionalProperties": false, @@ -613,7 +630,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable Gitleaks | Gitleaks is a secret scanner. | Enable Gitleaks integration. | v8.21.2" + "description": "Enable Gitleaks | Gitleaks is a secret scanner. | Enable Gitleaks integration. | v8.26.0" } }, "additionalProperties": false, @@ -639,7 +656,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable detekt | detekt is a static code analysis tool for Kotlin files. | v1.23.7" + "description": "Enable detekt | detekt is a static code analysis tool for Kotlin files. | v1.23.8" }, "config_file": { "type": "string", @@ -669,7 +686,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable RuboCop | RuboCop is a Ruby static code analyzer (a.k.a. linter ) and code formatter. | v1.73" + "description": "Enable RuboCop | RuboCop is a Ruby static code analyzer (a.k.a. linter ) and code formatter. | v1.75.5" } }, "additionalProperties": false, @@ -682,7 +699,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable Buf | Buf offers linting for Protobuf files. | v1.47.2" + "description": "Enable Buf | Buf offers linting for Protobuf files. | v1.54.0" } }, "additionalProperties": false, @@ -695,7 +712,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable Regal | Regal is a linter and language server for Rego. | v0.29.2" + "description": "Enable Regal | Regal is a linter and language server for Rego. | v0.33.1" } }, "additionalProperties": false, @@ -708,7 +725,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable actionlint | is a static checker for GitHub Actions workflow files. | v1.7.4" + "description": "Enable actionlint | is a static checker for GitHub Actions workflow files. | v1.7.7" } }, "additionalProperties": false, @@ -721,7 +738,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable PMD | PMD is an extensible multilanguage static code analyzer. Itโ€™s mainly concerned with Java. | v7.8.0" + "description": "Enable PMD | PMD is an extensible multilanguage static code analyzer. Itโ€™s mainly concerned with Java. | v7.13.0" }, "config_file": { "type": "string", @@ -738,7 +755,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable Cppcheck | Cppcheck is a static code analysis tool for the C and C++ programming languages. | v2.10-2" + "description": "Enable Cppcheck | Cppcheck is a static code analysis tool for the C and C++ programming languages. | v2.17.1" } }, "additionalProperties": false, @@ -751,7 +768,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable Semgrep | Semgrep is a static analysis tool designed to scan code for security vulnerabilities and code quality issues. | Enable Semgrep integration. | v1.99.0" + "description": "Enable Semgrep | Semgrep is a static analysis tool designed to scan code for security vulnerabilities and code quality issues. | Enable Semgrep integration. | v1.122.0" }, "config_file": { "type": "string", @@ -768,7 +785,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable CircleCI | CircleCI tool is a static checker for CircleCI config files. | v0.1.31151" + "description": "Enable CircleCI | CircleCI tool is a static checker for CircleCI config files. | v0.1.31687" } }, "additionalProperties": false, @@ -781,7 +798,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable SQLFluff | SQLFluff is an open source, dialect-flexible and configurable SQL linter. | v3.3.0" + "description": "Enable SQLFluff | SQLFluff is an open source, dialect-flexible and configurable SQL linter. | v3.4.0" } }, "additionalProperties": false, @@ -794,7 +811,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable Prisma Schema linting | Prisma Schema linting helps maintain consistent and error-free schema files | v0.10.0" + "description": "Enable Prisma Schema linting | Prisma Schema linting helps maintain consistent and error-free schema files | v0.10.1" } }, "additionalProperties": false, @@ -807,7 +824,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable OXC | OXC is a JavaScript/TypeScript linter written in Rust. | v0.16.5" + "description": "Enable OXC | OXC is a JavaScript/TypeScript linter written in Rust. | v0.16.10" } }, "additionalProperties": false, @@ -826,6 +843,19 @@ "additionalProperties": false, "default": {}, "description": "Configuration for Shopify Theme Check to ensure theme quality and best practices" + }, + "luacheck": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": true, + "description": "Enable Lua code linting | Luacheck helps maintain consistent and error-free Lua code | v1.2.0" + } + }, + "additionalProperties": false, + "default": {}, + "description": "Configuration for Lua code linting to ensure code quality" } }, "additionalProperties": false, @@ -845,11 +875,6 @@ "default": true, "description": "Enable the bot to reply automatically without requiring the user to tag it." }, - "create_issues": { - "type": "boolean", - "default": true, - "description": "Enable Issue creation by CodeRabbit from PR comments." - }, "integrations": { "type": "object", "properties": { @@ -893,7 +918,7 @@ "opt_out": { "type": "boolean", "default": false, - "description": "Opt out | Opt out of all knowledge base features that require data retention." + "description": "Opt Out | Disable all knowledge base features that require data retention. If you opt out after opting in, all of your existing knowledge base data will be removed from the system." }, "web_search": { "type": "object", @@ -1076,6 +1101,8 @@ "zh", "crh-UA", "crh", + "cs-CZ", + "cs", "nb", "no", "nl-NL", @@ -1085,22 +1112,78 @@ "fa-IR", "sv-SE", "de-LU", - "fr-FR" + "fr-FR", + "bg-BG", + "bg" ], "default": "en-US", "description": "Set the language for docstrings by using the corresponding ISO language code." + }, + "path_instructions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "File path glob pattern. Example: **/*.js" + }, + "instructions": { + "type": "string", + "maxLength": 20000, + "description": "Provides additional guidelines for docstring generation based on file paths." + } + }, + "required": ["path", "instructions"], + "additionalProperties": false + }, + "default": [], + "description": "Path Instructions | Provide additional guidelines for docstring generation based on file paths." } }, "additionalProperties": false, - "default": {}, + "default": { + "path_instructions": [] + }, "description": "Settings related to the generation of docstrings." + }, + "unit_tests": { + "type": "object", + "properties": { + "path_instructions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "File path glob pattern. Example: **/*.js" + }, + "instructions": { + "type": "string", + "maxLength": 20000, + "description": "Provides additional guidelines for unit test generation based on file paths." + } + }, + "required": ["path", "instructions"], + "additionalProperties": false + }, + "default": [], + "description": "Unit Test Generation | Provide additional guidelines for unit test generation based on file paths." + } + }, + "additionalProperties": false, + "default": { + "path_instructions": [] + }, + "description": "Settings related to the generation of unit tests." } }, "additionalProperties": false, "default": {} } }, - "additionalProperties": false + "additionalProperties": true } }, "$schema": "http://json-schema.org/draft-07/schema#"