diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index dbd44b4a..5c7190be 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1,3 @@ -*.ts @coderabbitai/typescript-reviewers +docusaurus.config.ts @coderabbitai/typescript-reviewers +src/**/*.ts @coderabbitai/typescript-reviewers +src/**/*.tsx @coderabbitai/react-reviewers diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..32cf3bf1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,13 @@ +--- +name: Bug report +about: Report a flaw, inaccuracy, or omission in our documentation. +title: "" +labels: bug, needs triage +assignees: jmacdotorg +--- + +**URL of the documentation page with this bug**: + +**A brief summary of the documentation bug**: + +(Optional) **Suggestions on how best we can address the bug**: diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 00000000..4dccde05 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,17 @@ +--- +name: Feature request +about: Request documentation for a new or existing CodeRabbit feature. +title: "" +labels: enhancement, needs triage +assignees: jmacdotorg +--- + +**The name of this feature**: + +**Expected launch date**: + +**Personnel (PM, TL, etc.)**: + +**Summary of this feature**, including a high-level description of the public documentation that it requires: + +**Links to relevant internal documentation:** diff --git a/.github/ISSUE_TEMPLATE/other-documentation-request.md b/.github/ISSUE_TEMPLATE/other-documentation-request.md new file mode 100644 index 00000000..b258a89b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/other-documentation-request.md @@ -0,0 +1,7 @@ +--- +name: Other documentation request +about: Request a documentation improvement other than new-feature coverage. +title: "" +labels: needs triage +assignees: jmacdotorg +--- diff --git a/README.md b/README.md index de8e5ece..8167aa97 100644 --- a/README.md +++ b/README.md @@ -37,20 +37,25 @@ Welcome to the official docs for [**CodeRabbit**](https://coderabbit.ai), the co ## Getting Started -1. Clone this repository: +1. Make sure that you have the following prerequisites installed: + + - [Node.js](https://nodejs.org/) + - [pnpm](https://pnpm.io/installation) + +2. Clone this repository: ```sh - git clone https://github.com/coderabbit-ai/coderabbit-docs.git + git clone https://github.com/coderabbitai/coderabbit-docs.git cd coderabbit-docs ``` -2. Install dependencies: +3. Install Node.js dependencies using `pnpm`: ```sh pnpm install ``` -3. Start the development server: +4. Start the development server: ```sh pnpm start diff --git a/docs/changelog.md b/docs/changelog.md index 24e903ff..21d85d40 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -5,6 +5,166 @@ description: The latest updates and changes to CodeRabbit. sidebar_position: 13 --- +## August 4, 2025 + +### Model Context Protocol (MCP) Server Integration - Early Access + +Pro users can now connect CodeRabbit to your external tools and knowledge bases to provide more contextual code reviews. Our AI automatically pulls relevant information from your documentation, project management tools, and internal wikis to better understand your code changes and business requirements. Connect your custom MCP servers through Settings > Integrations to get reviews and chat conversations that understand your full development context. + +## August 1, 2025 + +### Dark Theme Support for UI App + +CodeRabbit app now supports Light, Dark, and System themes. Use the new theme toggle next to your profile to switch modes. + +## July 23, 2025 + +### ⚡️ Unit Test Generation - Beta + +CodeRabbit's unit test generation is now available in Beta! Automatically generate comprehensive unit tests for your code changes, ensuring better test coverage and catching edge cases you might miss. Our AI analyzes your code structure and creates tests that follow best practices and your project's testing patterns. Learn more [here](https://docs.coderabbit.ai/finishing-touches/unit-test-generation), or just try it under ✨ Finishing Touches. + +## July 17, 2025 + +### Enhanced Reporting Capabilities + +We're excited to announce significant improvements to our reporting system that will make your automated reports more powerful and actionable! + +#### Exclusion Filters with NOT_IN Option + +Reports now support exclusion filters using the `NOT_IN` option, allowing you to filter out pull requests based on their repository, label, user, or team. This gives you more granular control over what appears in your reports, helping you focus on the most relevant information. + +#### Next Steps Section in Daily Standup Reports + +We've enhanced the default daily standup report template to include a "Next Steps" section. This provides clear guidance on what actions authors and reviewers should take regarding each pull request or change, making your reports more actionable and helping teams stay on track. + +#### CI/CD GitHub Action Check Status Awareness + +Reports now include CI/CD GitHub Action check status as a data source. Your reports will be aware of which CI/CD checks are failing or passing, giving you better visibility into the health of your pull requests and helping identify potential issues before they become blockers. + +#### Score Card Custom Report Option + +We've added a new optional score card report feature that allows you to grade and create report cards for your developers. This custom report optional data source provides a structured way to evaluate developer performance and contributions. See our [custom reports documentation](/guides/custom-reports#remove-prs-without-a-score-cardchart-bot-comment) for more details on how to implement score cards in your reports. + +## July 10, 2025 + +### Enhanced Python Static Analysis: nbqa Support for Jupyter Notebooks + +We're excited to announce enhanced Python static analysis capabilities with nbqa support for Jupyter Notebooks! + +Our existing integrated [Ruff](https://docs.astral.sh/ruff/), [Flake8](https://flake8.pycqa.org/) and [Pylint](https://pylint.pycqa.org/) tools now support linting Jupyter Notebooks (`.ipynb` files) using [nbqa](https://github.com/nbQA-dev/nbQA). This allows you to maintain code quality across your Python projects, including Jupyter Notebooks. + +See our [Ruff](/tools/ruff), [Flake8](/tools/flake8), and [Pylint](/tools/pylint) documentation for more details. + +## July 3, 2025 + +### Enhanced Python Static Analysis: Flake8 Support + +We're excited to announce enhanced Python static analysis capabilities with [Flake8](https://flake8.pycqa.org/) support! + +[Flake8](https://flake8.pycqa.org/) is a Python linting utility that wraps PyFlakes, pycodestyle, and Mccabe to check your Python code for style and logical errors. + +See our [tools documentation](https://docs.coderabbit.ai/tools/) for more details. + +## July 1, 2025 + +### Enhanced Code Guidelines Support + +We've expanded our code guidelines scanning capabilities to provide even better code review experiences. CodeRabbit now automatically scans and learns from additional configuration files to understand your organization's coding standards and preferences. + +**New supported patterns:** + +- `**/.cursorrules` - Cursor IDE rules and preferences +- `.github/copilot-instructions.md` - GitHub Copilot instructions +- `**/CLAUDE.md` - Claude-specific coding guidelines +- `**/.cursor/rules/*` - Cursor rules directory +- `**/.windsurfrules` - Windsurf IDE rules +- `**/.clinerules/*` - Cline IDE rules +- `**/.rules/*` - General rules directory + +These guidelines are automatically analyzed and applied during code reviews to ensure consistency with your team's coding standards. You can configure these patterns in the knowledge base section of your CodeRabbit settings. + +## June 27, 2025 + +### Enhanced PHP Static Analysis: PHPMD and PHPCS Support + +We're excited to announce enhanced PHP static analysis capabilities with two powerful new tools! + +- [PHPMD](https://phpmd.org/) (PHP Mess Detector) is a static analysis tool that detects potential problems in your PHP code such as possible bugs, suboptimal code, overcomplicated expressions, and unused parameters, variables, methods, and classes. + +- [PHPCS](https://github.com/squizlabs/PHP_CodeSniffer) (PHP CodeSniffer) is a development tool that ensures your PHP code conforms to coding standards like PSR-1, PSR-2, PSR-12, and custom standards. It can automatically fix many coding standard violations. + +See our [tools documentation](https://docs.coderabbit.ai/tools/) for more details. + +## June 11, 2025 + +### Enhanced Static Analysis: HTMLHint and Checkmake Support + +We're excited to announce that two new static analysis tools are now supported on CodeRabbit! + +- [HTMLHint](https://htmlhint.com/) is a static code analysis tool for HTML that helps maintain code quality by detecting common mistakes and enforcing best practices. + +- [Checkmake](https://github.com/mrtazz/checkmake) is a linter for Makefiles that helps ensure your build scripts follow best practices and maintain consistency. + +## June 10, 2025 + +### Unit Test Generation, Early Access + +We're excited to announce that our new unit test generation feature is now available in early access! CodeRabbit can now automatically generate unit tests for your code changes. + +Key capabilities: + +- **Intelligent Test Generation**: Automatically creates unit tests that cover edge cases, error scenarios, and core functionality +- **Context-Aware**: Generates tests that understand your existing codebase patterns and testing conventions +- **One-Click Integration**: Simply comment `@coderabbitai generate unit tests` on any pull request or specific file, or click on the checkbox available in the walkthrough comment for Early Access customers. + +You can customize the generated tests to fit your specific requirements. + +## June 5, 2025 + +### Enhanced Static Analysis: Dotenv Linter and Pylint Support + +We're excited to announce that two new static analysis tools are now supported on CodeRabbit! + +- [Dotenv Linter](https://github.com/dotenv-linter/dotenv-linter) is a fast, opinionated linter for `.env` files that helps prevent misconfigurations by detecting typos, invalid syntax, and duplicated keys. + +- [Pylint](https://github.com/PyCQA/pylint) is a widely used static analysis and code quality tool for Python. It checks for errors, enforces coding standards, and looks for code smells in your Python codebase. + +## May 25, 2025 + +### New Security and Code Quality Tools + +We're excited to announce the addition of two powerful tools to our static analysis arsenal: + +- **Brakeman**: A static analysis security vulnerability scanner for Ruby on Rails applications. It helps identify security issues in your Ruby codebase by analyzing Gemfile, Ruby files (_.rb), and ERB templates (_.erb). + +- **Clippy**: The official linter for Rust code, helping catch common mistakes and improve your Rust code quality. It analyzes \*.rs files and supports configuration through clippy.toml files. + +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. + +## 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 @@ -102,7 +262,7 @@ import ProPlanNotice from "@site/src/components/ProPlanNotice.mdx" New and Improved Dashboards to provide more useful feedback such as: -- Avgerage PR Merge Time +- Average PR Merge Time - Weekly Pull Request Activity - Number of PRs Reviewed - Acceptance rate of CodeRabbit Suggestions diff --git a/docs/faq.md b/docs/faq.md index f4158154..f248b517 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -10,6 +10,42 @@ import TabItem from '@theme/TabItem'; ## General Questions {#general-questions} +### How to trigger a CodeRabbit Review? + +Once installed, CodeRabbit automatically triggers a review when a pull request is opened against the main branch of any repository. We automatically detect the name of the primary branch (whether this be master, main, dev, etc). This branch restriction can be customized in your settings. + +You can also manually trigger a review at any time by commenting on a pull request with one of these commands (see [Commands](/guides/commands.md) for full list): + +- `@coderabbitai review` - Triggers a standard review +- `@coderabbitai full review` - Triggers a comprehensive review + +### How to run a review from my IDE? + +You can trigger CodeRabbit reviews directly from your IDE using our editor plugins: + +- [VSCode Extension](./guides/about-vscode.md) - For VSCode, Cursor or Windsurf users + +These plugins allow you to request reviews without leaving your development environment. See the individual plugin documentation for installation and usage instructions. + +### How to install CodeRabbit? + +View step by step instructions depending on your platform: + + + + See our [GitHub App installation guide](./platforms/github-com.md) for step-by-step instructions. + + + Follow our [GitLab integration guide](/platforms/gitlab-com.mdx) to get started. + + + Check out the [Bitbucket installation steps](/platforms/bitbucket-cloud.md) for detailed setup. + + + View our [Azure DevOps setup guide](/platforms/azure-devops.md) for complete installation instructions. + + + ### How accurate is CodeRabbit? > CodeRabbit demonstrates high accuracy in code reviews based on early adoption results. While 100% accuracy isn't guaranteed due to AI's evolving nature, our technology continuously improves through: @@ -27,6 +63,51 @@ CodeRabbit works with all programming languages, with varying proficiency based - Available training data - Community usage patterns +### What's the difference between CodeRabbit Code Reviews and CodeRabbit Reports? + +CodeRabbit offers two distinct features that serve different roles in your development workflow: + +#### CodeRabbit Code Reviews + +**Role**: Developer, QA, and Code Reviewer +**Access Level**: Full code access with comprehensive analysis capabilities + +**Key Features:** + +- **Complete Toolchain**: Runs all available analysis tools on your codebase +- **Static Analysis**: Can execute shell commands and perform deep static analysis against your codebase +- **Direct Code Access**: Has full access to code in issues and pull requests +- **Interactive Chat**: Provides chat features for real-time collaboration and questions +- **Comprehensive Review**: Analyzes code quality, security, performance, and best practices +- **Actionable Feedback**: Provides specific, line-by-line suggestions and improvements +- **Comment Interaction**: Engages with users through comments in pull requests and issues for clarifications and discussions +- **Available in All Tiers**: All features are available across Free, Lite, and Pro plans + +#### CodeRabbit Reports + +**Role**: Project Manager and Communication Hub +**Access Level**: Summary-only access without direct code interaction + +**Key Features:** + +- **Summary Generation**: Creates convenient, formatted summaries of all your recent pull requests +- **Customizable Prompts**: Allows you to select or create your own summarization templates +- **High-Level Overview**: Focuses on project progress and changes without code details +- **Comment Analysis**: Reads and summarizes existing comments and discussions +- **No Code Access**: Operates only on summaries and metadata, not the actual codebase +- **Communication Tool**: Designed for stakeholders who need updates without technical details +- **Multi-Channel Delivery**: Sends reports through various communication channels: + - Email notifications + - Slack integration + - Discord webhooks + - Microsoft Teams updates +- **Pro Plan Exclusive**: Reports feature is available only in the Pro plan tier + +**In Summary:** + +- **Code Reviews** = Technical analysis with full code access for developers +- **Reports** = High-level summaries with no code access for project management + ### Data Security @@ -92,7 +173,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.md) - **Branch Selection**: Default branch reviews enabled by default (configurable) ### Access & Permissions @@ -108,7 +189,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.md) :::tip Collaboration Mode When team members are active in PRs, use `@coderabbitai` to engage the bot. @@ -122,14 +203,15 @@ In-trial and open-source plans have lower rate limits than the paid plan. In all ::: -The following limits enforced _per developer_: +The following limits are enforced _per developer_: -| Feature | Free Plan | Trial Plan | OSS Plan | Pro/Lite Plan | -| ---------------- | ------------------------------------------ | ----------------------------- | ----------------------------- | ----------------------------- | -| Files per hour | 200/hour | 200/hour | 200/hour | 400/hour | -| Files per PR | 100 | 100 | 100 | 200 | -| 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 | +| Feature | Free Plan | Trial Plan | OSS Plan | Pro/Lite Plan | +| -------------------------------- | ------------------------------------------ | --------------------------------- | ----------------------------- | ----------------------------- | +| Files per hour | 200/hour | 200/hour | 200/hour | 400/hour | +| Files per PR | 100 | 100 | 100 | 200 | +| Reviews per hour | 3 back-to-back, then 2/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 (IDE Extension) | 1/hour | 5/hour (Pro trial), 1/hour(Other) | 1/hour | 5/hour (Pro), 1/hour(Lite) | +| 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} @@ -146,7 +228,7 @@ The following limits enforced _per developer_: 3. That's it. CodeRabbit will automatically start reviewing your PRs :::tip Need Help? -Visit our [Support](/getting-started/support) page for additional assistance or reach out to our team on [Discord](http://discord.gg/coderabbit). +Visit our [Support](/getting-started/support.md) page for additional assistance or reach out to our team on [Discord](http://discord.gg/coderabbit). ::: #### Unable to View Repositories in GitLab diff --git a/docs/finishing-touches/docstrings.md b/docs/finishing-touches/docstrings.md index 5d78366e..c504fa8a 100644 --- a/docs/finishing-touches/docstrings.md +++ b/docs/finishing-touches/docstrings.md @@ -15,7 +15,7 @@ Docstrings generation is part of the [finishing touches](/future-development#fin ## Usage -Once you are done with your pull request and its reviews, you may want to perform finishing touches to your code, such as adding in-code documentation. You can request CodeRabbit to generate docstrings by typing `@coderabbitai generate docstrings` in a comment under that pull request. +Once you are done with your pull request and its reviews, you may want to perform finishing touches to your code, such as adding in-code documentation. You can request CodeRabbit to generate docstrings by typing `@coderabbitai generate docstrings` in a comment under that pull request or by clicking the **Generate Docstrings** checkbox under **Finishing Touches** in the CodeRabbit Walkthrough. Once sent, CodeRabbit will perform the following actions: @@ -50,11 +50,9 @@ code_generation: These software forges are supported: -- [x] Azure DevOps -- [ ] Bitbucket Cloud -- [ ] Bitbucket Data Center -- [x] GitHub -- [x] GitLab +- Azure DevOps +- GitHub +- GitLab While Bitbucket is not officially supported, docstrings can still be generated. However, they will be posted in a comment under the pull request. Full support for Bitbucket is planned. @@ -62,24 +60,22 @@ While Bitbucket is not officially supported, docstrings can still be generated. These languages are supported: -- [x] Bash -- [x] C -- [x] C# -- [x] C++ -- [x] Elixir -- [x] Go -- [ ] Haskell -- [x] Java -- [x] JavaScript -- [x] Kotlin -- [x] Lua -- [x] Php -- [x] Python -- [x] React TypeScript -- [x] Ruby -- [x] Rust -- [ ] Scala -- [x] Swift -- [x] TypeScript +- Bash +- C +- C# +- C++ +- Elixir +- Go +- Java +- JavaScript +- Kotlin +- Lua +- Php +- Python +- React TypeScript +- Ruby +- Rust +- Swift +- TypeScript CodeRabbit uses `ast-grep` to parse the code. If you want a new language to be supported, please look into [Add New Language to ast-grep](https://ast-grep.github.io/contributing/add-lang.html#add-new-language-to-ast-grep) first. diff --git a/docs/finishing-touches/unit-test-generation.md b/docs/finishing-touches/unit-test-generation.md new file mode 100644 index 00000000..71fe5431 --- /dev/null +++ b/docs/finishing-touches/unit-test-generation.md @@ -0,0 +1,57 @@ +--- +title: Generate unit tests +description: Automated Unit Test Generation with CodeRabbit +--- + +```mdx-code-block +import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; + + +``` + +:::warning +This feature is in beta. +::: + +# Unit Test Generation + +Unit Test Generation is part of the [finishing touches](/future-development#finishing-touches). + +## Usage + +![Unit Test Generation](/img/finishing-touches/utg.gif) + +Once you are done with your pull request and its reviews, you may want to perform finishing touches to your code, such as adding unit tests. You can request CodeRabbit to generate unit tests by typing `@coderabbitai generate unit tests` in a comment under that pull request or by clicking a checkbox under **Generate Unit Tests** in the CodeRabbit Walkthrough. + +Once sent, CodeRabbit will perform the following actions: + +- The CodeRabbit agent will examine your code for places where it needs tests +- Unit tests will be generated for the PR, in a separate PR, in the same PR in a new commit, or in a comment to copy-paste, depending on your choice +- If (and only if) you choose to generate the unit tests in a separate PR, CodeRabbit will examine your GitHub checks (build steps and tests and such) and adjust the PR to deal with build failures, test failures and similar. + +## Path Instructions + +You can customize the generated unit tests 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: + unit_tests: + path_instructions: + - path: "**/*.ts" + instructions: | + Use vitest for testing framework. + Generate comprehensive test cases including edge cases and error conditions. + Do not omit the imports; the test file must be valid. +``` + +## Supported software forges + +These software forges are supported: + +- GitHub + +## Supported CI/CD systems + +These CI/CD systems are supported for post-generation adjustments: + +- GitHub actions diff --git a/docs/getting-started/adding-organizations.md b/docs/getting-started/adding-organizations.md index 5f4b635b..66741daa 100644 --- a/docs/getting-started/adding-organizations.md +++ b/docs/getting-started/adding-organizations.md @@ -21,3 +21,7 @@ This will grant CodeRabbit access to the selected organization, allowing it to: - Access user email addresses (read-only) > Note: Organizations control which applications are allowed to access their private data. You may need organization admin approval to complete this process. + +## What's next {#whats-next} + +- [Manage your subscription](/getting-started/subscription-management) diff --git a/docs/getting-started/configure-coderabbit.md b/docs/getting-started/configure-coderabbit.md index e8ee2e06..2e2a14f4 100644 --- a/docs/getting-started/configure-coderabbit.md +++ b/docs/getting-started/configure-coderabbit.md @@ -34,8 +34,7 @@ configuration in a YAML format. You can then copy the configuration to a ::: You can add a `.coderabbit.yaml` configuration file to the root of your -repositories. Below is a sample YAML file that can be used as a starting point -and changed as needed: +repositories. For a complete sample `.coderabbit.yaml` file which you can add to your repository and update as needed, see [Configuration file template](/reference/yaml-template). Write your configuration file in the below editor to validate: diff --git a/docs/getting-started/quickstart.md b/docs/getting-started/quickstart.md index 17cc091c..c6f1d3b8 100644 --- a/docs/getting-started/quickstart.md +++ b/docs/getting-started/quickstart.md @@ -30,7 +30,7 @@ Create a new, private repository on GitHub. Name the new repository `coderabbit- To integrate CodeRabbit with your GitHub account, follow these steps: -1. Visit [the CodeRabbit login page](https://app.coderabbit.ai/login). +1. Visit [the CodeRabbit login page](https://app.coderabbit.ai/login?free-trial). 1. Click **Login with GitHub**. 1. Click **Authorize coderabbitai**. diff --git a/docs/getting-started/subscription-management.md b/docs/getting-started/subscription-management.md index 4483ce78..6eabd3ee 100644 --- a/docs/getting-started/subscription-management.md +++ b/docs/getting-started/subscription-management.md @@ -57,3 +57,7 @@ To modify the number of seats in your subscription: ![Changing your plan](../../static/img/getting-started/edit-subscription.png) ![Changing your plan](../../static/img/getting-started/change-seats.png) + +## What's next {#whats-next} + +- [Control administrative access](/guides/roles) diff --git a/docs/getting-started/support.md b/docs/getting-started/support.md index 9b1ef18b..5aeb9589 100644 --- a/docs/getting-started/support.md +++ b/docs/getting-started/support.md @@ -14,7 +14,7 @@ All CodeRabbit users have access to the [CodeRabbit Discord Server](http://disco ## Support Tickets :::tip -For assistance from our support team, click the help icon located in the bottom right corner of the [CodeRabbit UI](https://app.coderabbit.ai/login). This will open a chat window where you can submit your support ticket. +For assistance from our support team, click the help icon located in the bottom right corner of the [CodeRabbit UI](https://app.coderabbit.ai/login?free-trial). This will open a chat window where you can submit your support ticket. ::: Complete the support ticket by providing your name, email, a description of your issue, and attaching any necessary files. If you are reporting a bug, please provide the GitHub or GitLab organization name. diff --git a/docs/guides/about-vscode.md b/docs/guides/about-vscode.md index 3e484ffe..ada6f06f 100644 --- a/docs/guides/about-vscode.md +++ b/docs/guides/about-vscode.md @@ -35,3 +35,4 @@ The extension makes only basic CodeRabbit review features available, with defaul - [Install the VSCode extension](/guides/install-vscode) - [Use the VSCode extension](/guides/use-vscode) +- [Use with Self-hosted CodeRabbit](/guides/use-vscode-selfhosted) diff --git a/docs/guides/code-review-best-practices.md b/docs/guides/code-review-best-practices.md new file mode 100644 index 00000000..426617e8 --- /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: Code reviews +--- + +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..6c571670 --- /dev/null +++ b/docs/guides/code-review-overview.md @@ -0,0 +1,100 @@ +--- +title: Review pull requests +description: An overview of CodeRabbit's core code review features. +sidebar_label: Overview +--- + +import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx' + +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. + +### Which pull requests get automatically reviewed {#eligibility} + +CodeRabbit automatically reviews a pull request when **either** of the following statements is true: + +- The pull request is in a public repository. CodeRabbit reviews pull requests against the main branch of your public repositories by default. This feature is available to every subscription tier, including the free plan. +- The pull request is in a private repository and your organization is on the Pro plan with a seat assigned to you. Only under this condition does CodeRabbit review private-repository pull requests. + + + +## 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 f7cbe002..43e6283a 100644 --- a/docs/guides/commands.md +++ b/docs/guides/commands.md @@ -3,92 +3,152 @@ title: Control and manage code reviews description: Learn how to control CodeRabbit using commands in pull request comments --- -# 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 index 7a1fb8bd..8bd0672a 100644 --- a/docs/guides/config-vscode.md +++ b/docs/guides/config-vscode.md @@ -14,11 +14,11 @@ The instructions on this page are specific to using the extension with VSCode. I To navigate to the settings screen for the CodeRabbit VSCode extension, follow these steps: -1. In the activity bar, click the Extensions icon. +1. Open the CodeRabbit activity bar/sidebar. -1. In the sidebar, under **Installed**, click the gear-shaped **Manage** icon in the CodeRabbit row. +1. In the sidebar, click on gear shaped icon on top right(beside logout icon). -1. In the menu that appears, select **Settings**. +1. You can also search for CodeRabbit: Settings in the command palette to open the settings. The settings screen contains the following configuration controls. @@ -28,9 +28,21 @@ The **Agent Type** setting lets you choose the extension's response to using the - **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. + This works only with VSCode(using Copilot) and Cursor(you have to start the task). 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. +- **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](https://www.anthropic.com/claude-code) installed for this option to be effective. + +- **Codex CLI**: The extension opens the Terminal pane of your IDE and tries to use the `codex` command-line program to apply the suggested fix to your code. You need to have [Codex CLI](https://github.com/openai/codex) installed for this option to be effective. + +- **OpenCode**: The extension opens the Terminal pane of your IDE and tries to use the `opencode` command-line program to apply the suggested fix to your code. You need to have [OpenCode](https://opencode.ai) installed for this option to be effective. + +- **Cline**: The extension opens the `Cline` sidebar and runs a task to apply the suggested fix to your code. You need to have the [Cline](https://cline.bot/) extension installed for this option to be effective. + +- **Roo**: The extension opens the `Roo` sidebar and runs a task to apply the suggested fix to your code. You need to have the [Roo](https://github.com/RooCodeInc/Roo-Code) extension installed for this option to be effective. + +- **Kilo Code**: The extension opens the `Kilo Code` sidebar and runs a task to apply the suggested fix to your code. You need to have the [Kilo Code](https://kilocode.ai/) extension installed for this option to be effective. + +- **Augment Code**: The extension opens the `Augment Code` sidebar with the prompt to apply the suggested fix to your code, and you can start the task. You need to have the [Augment Code](https://www.augmentcode.com/) extension 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. @@ -48,11 +60,9 @@ The **Auto Review Mode** setting lets you control the behavior of the automatic 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`. +## Use with self-hosted CodeRabbit {#self-hosted-coderabbit} -To turn off timeouts, set this value to `0`. +This setting is only used when you're using a self-hosted instance of CodeRabbit. If you're using the CodeRabbit Cloud service, you don't need to configure this setting. You will need to login and logout of the extension after adding this value. ## What's next {#whats-next} diff --git a/docs/guides/configuration-overview.md b/docs/guides/configuration-overview.md new file mode 100644 index 00000000..3e54ebbe --- /dev/null +++ b/docs/guides/configuration-overview.md @@ -0,0 +1,84 @@ +--- +title: Configure CodeRabbit +description: Learn the basics of configuring CodeRabbit for your organization. +sidebar_label: Overview +--- + +After you finish [integrating CodeRabbit with your Git platform](/platforms/), +you can configure CodeRabbit to best fit the needs of your Git platform's organization and repositories. + +## About CodeRabbit configuration + +CodeRabbit has [a lot of configuration options](/reference/configuration), with default settings that are designed to meet most needs. CodeRabbit is designed to work "out +of the box": if you don't change any of the +configuration settings away from the defaults, then CodeRabbit starts automatically +adding code reviews to new pull requests in your repositories. + +However, understanding how to configure CodeRabbit lets you tune its behavior +to the particulars of your team's code. A few advantages of manually configuring +CodeRabbit include the following: + +- Adjust the level of detail in CodeRabbit code reviews. +- Customize review instructions to meet your specific coding standards. +- Take advantage of agentic workflows that can speed up your review cycles. + +## Configuration methods {#methods} + +You can configure CodeRabbit in several ways, from global organization settings +down to configuration directives for specific repositories. + +### Organization settings {#org} + +If you want to apply the same CodeRabbit configuration to all of your organization's repositories, then +you can manage organizational settings using the CodeRabbit web UI. + +For more information, see [Set your organization preferences](/guides/organization-settings). + +### Repository settings {#repo} + +If you want to apply separate CodeRabbit configuration to your organization's different repositories, then you can +manage repository-specific CodeRabbit settings in two ways: + +- Add a `.coderabbit.yaml` file to the top level of your repository. +- Use the CodeRabbit web interface. + +For more information, see [Set your repository preferences](/guides/repository-settings). + +While the web interface provides and easier way to explore the available configuration options for your repository, we recommend using a `.coderabbit.yaml` file [as a best practice](/guides/setup-best-practices#yaml). + +## Configuration priority {#priority} + +CodeRabbit follows a specific hierarchy when determining which configuration settings to use. Understanding this priority system helps you manage your configuration effectively: + +### Priority order (highest to lowest) + +1. **Local `.coderabbit.yaml` file of head branch** +2. **Repository settings** (web UI) +3. **Organization settings** (web UI) + +### How priority works + +- **If you have a local `.coderabbit.yaml` file in your head branch**: All repository and organization settings are ignored. Only the local YAML file configuration is used. Anything not defined in that file uses default settings. +- **If you don't have a local YAML file but have enabled repository settings**: Organization settings are ignored. Only repository settings are used. +- **If you have organization settings and repository settings are disabled**: Only organization settings are used. + +### Configuration inheritance + +When a configuration source is active, it completely overrides all lower-priority sources. For example, if you set `reviews.tools.github-checks.timeout_ms` to `900000` in organization settings, but you have a local `.coderabbit.yaml` file that doesn't define this setting, CodeRabbit will use the default value of `90000` instead of the organization setting. + +This means that configuration is not merged or inherited - the highest priority source takes complete control over all settings. + +## Initial configuration {#initial} + +The [Initial configuration guide](/guides/initial-configuration) tours you through several settings that we +recommend that you review after you set up CodeRabbit with your organization. + +## Learnings {#learnings} + +As a complement to the configuration methods listed above, CodeRabbit keeps an internal database with _learnings_ that it collects about your team's code review preferences, based on your interactions with the CodeRabbit bot over time. CodeRabbit learnings let you fine-tune the ways that CodeRabbit conducts its code reviews in ways that are highly specific to your repositories, and your team's coding styles. + +For more information, see [Teach CodeRabbit your review preferences](/guides/learnings). + +## What's next {#whats-next} + +- [Initial configuration guide](/guides/initial-configuration) diff --git a/docs/guides/custom-reports.md b/docs/guides/custom-reports.md index dbc04280..48d37a74 100644 --- a/docs/guides/custom-reports.md +++ b/docs/guides/custom-reports.md @@ -11,6 +11,8 @@ import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; CodeRabbit Pro allows you to create custom reports tailored to your specific needs using a flexible prompt-based system. This guide will help you understand how to create effective custom reports. +For a conceptual overview of reports in CodeRabbit, see [Generate reports](/guides/reports-overview). + ## Understanding Custom Reports Custom reports allow you to: @@ -101,7 +103,7 @@ Contained within the `` tag. #### Summarized PR Details - ``: string - Contains the body of your pull request (aka the PR description at the top of the PR page). -- ``: string - Contains a file by file summary of the changes made in the PR in markdown format. This summary is generated by CodeRabbit AI durring the PR review process. This includes several sections for each file that was changed: +- ``: string - Contains a file by file summary of the changes made in the PR in markdown format. This summary is generated by CodeRabbit AI during the PR review process. This includes several sections for each file that was changed: - `filename`: string - The name of the file that was changed. - `AI-generated summary of changes`: markdown - An overall summary of the changes made in the file. - `Alterations to the declarations of exported or public entities`: markdown - A more specific breakdown of the changes made to the file such as exactly what was added, removed, or modified. @@ -115,6 +117,14 @@ Contained within the `` tag. - ``: datetime - The date and time the comment was last updated. - ``: markdown - The content of the comment. +#### CI/CD Check Status + +- ``: array of check objects - Contains all CI/CD checks for the PR. _GitHub Only_. +- ``: object - Each individual check is wrapped in this tag and is an object with the following properties: + - ``: string - The name of the CI/CD check. + - ``: string - The status of the check (e.g., "success", "failure", "in_progress", "canceled"). + - ``: string - The URL to view the detailed results of the check. + Here's an example prompt that uses these data points: ```text @@ -293,6 +303,166 @@ Issues and tickets brings in conversations, descriptions, and comments from Jira - ``: markdown - The description of the issue. - ``: array of comment objects - Contains all the comments made on the issue. +#### Remove PRs without a "Score Card/Chart" bot comment + +This option gives you the ability to create a report limited only to pull requests containing a "Score Card" or "Score Chart" bot comment from CodeRabbit or other bots. To enable issues and tickets you must include the tag `` in your prompt. + +> **IMPORTANT:** This will automatically remove any pull requests from your reports if they do not contain a "Score Card" or "Score Chart" bot comment. Using this option without setting up a flow to create these comments will result in `No new pull request activity in the last XYZ hours` errors. Do not enable this option unless you have asked CodeRabbit to create a "Score Card" through a comment or implemented the "Score Chart" bot comment flow below. + +For example, you can ask CodeRabbit to check several conditions on a pull request and produce a "Score Chart": + +
+Click to view example User Score Card/Chart Comment: + +![Score Card/Chart Trigger Comment Example](/img/guides/score-card-trigger-comment.png) + +```markdown +@coderabbitai +Use the to guide the content of the summary. Use the format shown in <\_example> but do not include or refer to the example's content in the final summary/report. + + + +**Instructions:** +Generate a weekly code review report for the author of this pull request only following scoring parameters. Calculate the scores and compile the results into a table so that the team-wise average score can be easily determined. +**Scoring Parameters:** + +1. **Basic Code Standards (Score out of 2)** + + - Avoidance of hard-coded values + - No repetition of code (DRY principle) + +2. **Code Readability (Score out of 2)** + + - Presence of meaningful comments + - Proper variable declaration using `const` and `let` + +3. **Error Handling (Score out of 4)** + + - Handling failure scenarios (e.g., try-catch, fallbacks) + - Proper loading state implementation (e.g., button click loading states) + - Handling edge cases (e.g., checking for undefined or missing values) + - Input validation (ensuring correct user inputs) + +4. **Circle CI Check Validation (Score: 0 or 1)** + - `0` → Not Passed + - `1` → Passed + +**Final Score Calculation:** +Combine the scores from the parameters above to derive the final code quality score (out of 9). +**Output Format:** +Provide the final report in a table format with the following columns (use shorthand notations), be sure to include this list at the top above the chart in the "Column Notation" section so users understand what the columns mean: + +- **User Name (User)** +- **Basic Code Standards (BCS) (out of 2)** +- **Code Readability (CR) (out of 2)** +- **Error Handling (EH) (out of 4)** +- **Shopify Theme Check (CI) (out of 1)** +- **Final Code Quality Score (FCQS) (out of 9)** + + + +<\_example> + +## Column Notation + +- **User Name (User)** +- **Basic Code Standards (BCS) (out of 2)** +- **Code Readability (CR) (out of 2)** +- **Error Handling (EH) (out of 4)** +- **Shopify Theme Check (CI) (out of 1)** +- **Final Code Quality Score (FCQS) (out of 9)** + +## Score Chart + +| User | BCS (2) | CR (3) | EH (2) | CI (1) | FCQS (9) | +| -------- | ------- | ------ | ------ | ------ | -------- | +| John Doe | 2 | 3 | 2 | 1 | 9 | + + +``` + +
+ +Then CodeRabbit will reply with a score for you pull request: + +
+Click to view resulting Score Card/Chart bot comment: + +![CodeRabbit Score Card/Chart Result Comment Example](/img/guides/score-card-result-comment.png) + +
+ +You can then utilize this in a report. We recommend your report looks specifically for these score cards and puts together a unified report: + +
+Click to view example Report Prompt when using Score Card/Chart: + +![Report Example](/img/guides/score-card-report-result.png) + +![Where to put this prompt](/img/guides/where-score-report-prompt-go.png) + +Prompt Example: + +```markdown +Use the to guide the content of the summary. Use the format shown in but do not include or refer to the example's content in the final summary/report. + + +**Instructions:** + +Locate the score chart comment in the . There will be a single comment with data on these fields: + +- **User Name (User)** +- **Basic Code Standards (BCS) (out of 2)** +- **Code Readability (CR) (out of 2)** +- **Error Handling (EH) (out of 4)** +- **Shopify Theme Check (CI) (out of 1)** +- **Final Code Quality Score (FCQS) (out of 9)** + +These details may also be in the form of a chart such as: + +## Score Chart + +| User | BCS (2) | CR (3) | EH (2) | CI (1) | FCQS (9) | +| -------- | ------- | ------ | ------ | ------ | -------- | +| John Doe | 2 | 3 | 2 | 1 | 9 | + +You will create a new chart averaging all the values from various pull requests for each author. Only include pull requests with a `Score Chart`. Do not invent or create score charts if none exist. + + + + + +## Column Notation + +- **User Name (User)** +- **Basic Code Standards (BCS) (out of 2)** +- **Code Readability (CR) (out of 2)** +- **Error Handling (EH) (out of 4)** +- **Shopify Theme Check (CI) (out of 1)** +- **Final Code Quality Score (FCQS) (out of 9)** + +## Score Chart + +| User | BCS (2) | CR (3) | EH (2) | CI (1) | FCQS (9) | PR URL | +| -------- | ------- | ------ | ------ | ------ | -------- | ------ | +| John Doe | 2 | 3 | 2 | 1 | 9 | URL | +| Alex Foo | 2 | 3 | 2 | 1 | 9 | URL | + + + + +``` + +
+ +**Best Practices for Score Cards/Charts:** + +- The reporting bot only has access to your comments and summary (like a project manager) if you want to make a report looking for these score card/chart comments make sure the reviewer does this ahead of time. +- Only include checks for very specific scenarios, such as a specific check failing or using tabs vs spaces. +- Do not use general rules without explaining specifically what they mean. If you add "Insure the pull request follows development best practices" you must define what "development best practices" actually mean or the AI will guess. +- Make one point for each specific check and make sure its a True/False condition. +- Instead of manually commenting on pull requests, you can use the [GitHub Actions Bot](https://github.com/marketplace/actions/create-or-update-comment) to automatically comment on pull requests and trigger CodeRabbit score card/chart comments by including `@coderabbitai` in the comment. + ## Best Practices 1. **Be Specific** @@ -558,6 +728,6 @@ These are the available emojis and the type of change they represent. Do not usi ## Related Resources -- [Scheduled Reports](./scheduled-reports.md) -- [On-demand Reports](./ondemand-reports.md) +- [Schedule reports](/guides/scheduled-reports) +- [Generate reports on demand](/guides/ondemand-reports) - [API Documentation](https://api.coderabbit.ai/api/swagger/) 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/initial-configuration.md b/docs/guides/initial-configuration.md new file mode 100644 index 00000000..5cea2afd --- /dev/null +++ b/docs/guides/initial-configuration.md @@ -0,0 +1,200 @@ +--- +title: Initial configuration guide +description: A tour through some initial configuration setup. +--- + +This page provides a tour through a selection of key CodeRabbit configuration options. + +For a general overview of how configuration in CodeRabbit works, see [Configure CodeRabbit](/guides/configuration-overview). For an exhaustive reference of all configuration options, see [Configuration reference](/reference/configuration). + +## How to use this guide {#use} + +This guide walks you through several CodeRabbit configuration options that you +can set in order to tune CodeRabbit code review behavior for your repositories. + +The default behavior and settings of CodeRabbit +works for most repositories, in most situations. However, becoming familiar with +the key settings described by this page can help you tune the behavior of +CodeRabbit for the specific needs of your team. You can use this guide when initially setting up your organization and repositories with CodeRabbit, or you can return to it after using CodeRabbit +for a while, when you feel ready to customize its behavior. + +Each section in the guide links to specific entries in the configuration reference. Each entry in the linked reference specifies the location of its configuration setting, in either the CodeRabbit web UI or your `.coderabbit.yaml` file. + +## Data retention and knowledge base settings {#data-retention} + +These settings help you control how much data about your code that CodeRabbit retains. +CodeRabbit temporarily stores information about your repositories in order to tailored reviews more quickly and better tailored to your team's needs. You can opt of these features if your organization has stricter data-retention policies. + +For more information about CodeRabbit data-retention policies, see +[Data privacy and security](/#data-privacy-and-security). + +### Enable or disable data retention globally {#data-retention-setting} + +:::note +This setting is available only at the organization level, and not per-repository. +::: + +Your CodeRabbit organization has a data-retention setting which acts as a master-switch to all CodeRabbit features that require it to store its own data about your repositories. If you disable data retention, then none of your repositories can use knowledge base or caching features, even if you configure those repositories to enable them. + +We recommend leaving this on. However, if your use of CodeRabbit requires strict data retention policy, then you can turn this off. + +For more information, see +[Data retention](/reference/configuration#data-retention) in the configuration reference. + +### Configure cache use {#cache} + +By default, CodeRabbit keeps a temporary cache of data about your repository in order to make subsequent code reviews faster. If this conflicts with your organization's data-retention policies, then you can disable this feature. + +For more information, see +[Disable cache](/reference/configuration#disable-cache) in the configuration reference. + +### Configure knowledge base retention {#opt-out} + +By default, CodeRabbit keeps its own [_knowledge base_](/integrations/knowledge-base): a store of metadata about your repositories, your team's history of pull requests, linked issues, and learnings about how CodeRabbit should tailor its own review behavior to best serve your team. If this long-term knowledge base storage conflicts with your organization's data-retention policies, then you can disable this feature. + +For more information, see +[Opt out](/reference/configuration#opt-out) in the configuration reference. + +### Configure learnings {#learnings} + +CodeRabbit learns your team's review preferences by letting you [teach it your preferences in plain language during code reviews](/guides/learnings). CodeRabbit remembers these preferences, and applies them to subsequent code reviews in the same repository. + +This setting lets you set the scope of which stored learnings that CodeRabbit should apply to its code reviews. For more information, see [Learnings](/reference/configuration#learnings) in the configuration reference. + +## Tune the length of code reviews {#content} + +By default, CodeRabbit writes thorough code reviews with several sub-sections. If you'd rather have CodeRabbit generated shorter reviews then you can change some of the following settings: + +- [Collapse walkthrough](/reference/configuration#collapse-walkthrough): wraps the detailed summary of proposed changes in collapsed-but-expandable container. (Off by default.) +- [Changed files summary](/reference/configuration#changed-files-summary): lists of files affected by this pull request. +- [Sequence diagrams](/reference/configuration#sequence-diagrams): includes a visual diagram of object interactions. +- [Assess linked issues](/reference/configuration#assess-linked-issues): assesses how well the pull request addresses any linked issues. +- [Related issues](/reference/configuration#related-issues): lists issues found in your issue tracker that might be related to this pull request. +- [Related pull requests](/reference/configuration#realted-prs): lists pull requests that might be related to this pull request. +- [Suggested labels](/reference/configuration#suggested-labels): Suggests labels for this pull request. +- [Suggested reviewers](/reference/configuration#suggested-reviewers): automatically suggest reviewers for PR +- [Poem](/reference/configuration#poem): generates a short poem about this pull request. + +## Adjust path-specific CodeRabbit behavior {#path} + +You can give CodeRabbit additional instructions for reviewing specific files or +locations in your repository, or configure CodeRabbit to disregard certain file paths +during code reviews. + +For an overview about using path-based instructions in CodeRabbit, see [Path-based instructions](/guides/review-instructions#path-based). + +### Add path filters {#filters} + +If your repository contains files or locations that CodeRabbit should disregard when preparing code reviews—or you want CodeRabbit to limit its consideration to only certain files—then you can define one or more _path filters_. Adding path filters to a large repository containing a lot of data, generated files, or other non-code content can let CodeRabbit work faster. + +For example, the following `.coderabbit.yaml` excerpt instructs CodeRabbit to take review context only the contents of directories named `src/` in your repository, while disregarding any individual files with `.bin` or `.csv` extensions. + +```yaml +path_filters: + - "!**/*.bin" + - "!**/*.csv" + - "**/src/**" +``` + +For more information, see [Path filters](/reference/configuration#path-filters) in the CodeRabbit configuration reference. + +### Add general path instructions {#review-path} + +You can set _path instructions_ that provide CodeRabbit with additional review instructions for various files or locations in your repository. Each path instruction specifies a path specification and a set of instructions, the latter of which you express using natural language. + +For example, to give CodeRabbit review instructions specific to JavaScript and TypeScript files, you can add a section like this to your repository's `.coderabbit.yaml` file: + +```yaml +path_instructions: + - path: `src/**/*.{ts,tsx,js}` + instructions: "Review the React.js, TypeScript, JavaScript code for best practices. Check for common security vulnerabilities, such as SQL injection, insecure dependencies, and sensitive data exposure." +``` + +For more information, see [Path instructions](/reference/configuration#path-instructions) in the configuration reference. + +### Add documentation or unit-test path instructions {#doc-path} + +Similar to the general path instructions described by the previous section, you +can define path-based instructions that direct CodeRabbit to generate inline +documentation or unit tests, with specific instructions associated with different +locations or filenames. + +For more information, see [Docstrings](/reference/configuration#docstrings) and [Unit tests](/reference/configuration#unit-tests) in the configuration reference. + +## Set Automatic review behavior {#auto} + +By default, CodeRabbit automatically generates incremental code reviews for every new or updated pull request made against a repository's default branch. These settings listed in this section let you tune the behavior. + +### Configure incremental reviews {#incremental} + +By default, CodeRabbit generates a new automated review comment every time the branch of an existing pull request gets an additional commit pushed to it. + +If you want to limit CodeRabbit to posting only an initial automated review for a new pull request, with no automated response to further updates, then you can turn off this incremental-review behavior. If you do turn it off, then you can still [manually request reviews](/guides/commands#request). + +For more information, see [Automatic incremental review](/reference/configuration#automatic-incremental-review) in the configuration reference. + +### Restrict automatic reviews to certain labels {#labels} + +If you want to be choosier about which pull requests CodeRabbit should automatically review, then you can restrict it to review only pull requests that you mark with certain labels. + +For more information, see [Labels](/reference/configuration#labels) in the configuration reference. + +### Automatically review more branches {#branches} + +If you want CodeRabbit to extend its automatic-review attention beyond the default branch of your repository—that is, `main` or `master`, usually—then you can give CodeRabbit a list of other branches that it is allowed to review. + +For more information, see [Base branches](/reference/configuration#base-branches) in the configuration reference. + +## Configure tools {#tools} + +CodeRabbit has access to dozens of industry-standard open-source tools to help it perform its code reviews. These tools include a variety of linters, security analyzers, and other utilities. For a full list, see [List of supported tools](/tools/list). CodeRabbit chooses which tools to apply to a given code review on a case-by-case basis. + +By default, CodeRabbit considers every tool available to it during code reviews. If you want CodeRabbit to disregard certain tools, then you can disable them. + +Several tools that CodeRabbit uses also allow you to specify a path to a tool-specific configuration file in your repository. For example, the following `.coderabbit.yaml` excerpt directs CodeRabbit to use configuration files in the repository's `/pmd-config` directory when using the `pmd` tool: + +```yaml +reviews: + tools: + pmd: + enabled: true + config_file: /pmd-config/*.yml +``` + +For more information, see [Tools](/reference/configuration#tools) in the configuration reference. + +## Other code review settings {#other} + +### Adjust code-review strictness {#profile} + +If you want CodeRabbit to apply a much stricter and more nitpicky stance to its code reviews, then you can switch its _profile_ setting from `chill` to `assertive`. + +CodeRabbit is aware of nitpickier output from the linters and other tools that it applies to code reviews, but includes less of it in its own review comments when the profile is set to `chill`. To have CodeRabbit include more nitpicky tool output in reviews, use the `assertive` profile. + +For more information, see [Profile](/reference/configuration#profile) in the configuration reference. + +### Configure pull request approval {#request-changes} + +By default, CodeRabbit doesn't mark pull requests as approved after any code review, even if CodeRabbit doesn't have any further significant changes to suggest. This leaves the job of formal pull request approval entirely up to human reviewers. + +If you want to allow CodeRabbit to mark pull requests as approved, then you can enable the _request changes workflow_ setting. If you do, then CodeRabbit can approve pull requests after it reviewed a pull request and had all of its comments resolved. + +This can be useful if you have a workflow that requires several reviewers to approve a pull request before anyone can merge it. For example, if you have configured your repository on your Git platform to require two approvals for any pull request, then activating this CodeRabbit setting lets you merge a pull request after approval from CodeRabbit plus one human reviewer. This can help reduce your team's code-review load. + +:::note +We recommend a policy of always requiring the approval of at least one human reviewer, even if you allow CodeRabbit to approve pull requests. As with an generative AI technology, CodeRabbit works best as a helpful partner to your team, and not as a replacement for human expertise or judgment. +::: + +For more information, see [Request Changes Workflow](/reference/configuration#request-changes-workflow) in the configuration reference. + +### Configure chat-based issue creation {#chat-issues} + +You can [ask CodeRabbit to create issues for you](https://docs.coderabbit.ai/guides/issue-creation) in the comments of a pull request that it's reviewing. + +If you have integrated CodeRabbit with Jira or Linear, then you can tune this behavior a little more, restricting this feature to private repositories—the default setting—or disabling it entirely. + +For more information, see [Integrations](/reference/configuration#integrations) in the configuration reference. + +## What's next {#whats-next} + +- [Setup and configuration best practices](/guides/setup-best-practices) diff --git a/docs/guides/install-vscode.md b/docs/guides/install-vscode.md index ec71e213..99e3b662 100644 --- a/docs/guides/install-vscode.md +++ b/docs/guides/install-vscode.md @@ -14,7 +14,7 @@ The instructions on this page are specific to using the extension with VSCode. I 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). +If you don't already have an account, you can create one by visiting [the CodeRabbit login page](https://app.coderabbit.ai/login?free-trial). ## Install the extension @@ -40,6 +40,14 @@ To install the CodeRabbit extension, follow these steps: 1. In your web browser, log into your CodeRabbit account. +1. After signing in, the browser will redirect you back to VSCode. If the redirect does not occur, follow these steps: + + 1. Copy the code displayed in the success window. + + 2. Click **Paste code from browser**. + + 3. Paste the code into the input field that appears. + This connects your CodeRabbit account with the CodeRabbit VSCode extension. ## Install using the marketplace website @@ -51,5 +59,5 @@ If you do install the extension this way, then you still need to connect your Co ## What's next - [Use the VSCode extension](/guides/use-vscode) - - [Configure the VSCode extension](/guides/config-vscode) +- [Use with Self-hosted CodeRabbit](/guides/use-vscode-selfhosted) diff --git a/docs/guides/learnings.md b/docs/guides/learnings.md new file mode 100644 index 00000000..38477db6 --- /dev/null +++ b/docs/guides/learnings.md @@ -0,0 +1,124 @@ +--- +title: Teach CodeRabbit your review preferences +description: An overview of the CodeRabbit learnings feature. +--- + +This page describes how you can configure the code-review behavior of CodeRabbit using natural-language +chat. + +For a conceptual overview of CodeRabbit configuration methods, see [Configure CodeRabbit](/guides/configuration-overview). For more information about performing code reviews with CodeRabbit, see +[Review pull requests](/guides/code-review-overview). + +## About CodeRabbit learnings {#about} + +As your team works with CodeRabbit, it learns your team's code-review +preferences based on chat interactions, and adds these preferences +to an internal database that it associates with your Git platform organization. We call these internal records _learnings_. + +
+ +
+ +CodeRabbit learnings are flexible, natural-language statements about code-review preferences whose purpose can include the following: + +- Special instructions about reviewing particular files. +- Guidance for reviewing all of the files of one repository. +- Code-review preferences that CodeRabbit must apply across all of your organization's repositories. + +Every time CodeRabbit prepares to add a comment to a pull request or issue, it loads all of the learnings that it has collected about your organization's code review preferences. CodeRabbit applies these learnings as additional context or instructions for its comment. + +CodeRabbit learnings complement the more traditional configuration that you set for your organization and its repositories using the CodeRabbit web interface or [`.coderabbit.yaml` files](/getting-started/configure-coderabbit). Learnings give you a convenient way to quickly set or correct the behavior of CodeRabbit in ways that are highly specific to your team's coding style, or in ways that the CodeRabbit configuration options don't otherwise account for. + +You can review and edit your organization's CodeRabbit learnings at any time, as detailed later in this page. + +## Add learnings {#add} + +To add learnings to the database CodeRabbit keeps about your organization's preferences, communicate +your preferences directly to the appropriate CodeRabbit service account using natural language, in a comment attached to any pull request or issue. For more information about chatting with CodeRabbit using comments, see [CodeRabbit chat](/guides/agent_chat/). + +If CodeRabbit decides to create one or more learnings based on a comment, then it makes this explicit in its response to that comment by adding a collapsible section titled **Learnings Added** to its own response comment. + +### An example of adding a learning {#example} + +Imagine a scenario where CodeRabbit has reviewed a GitHub-based pull request from your team that adds a feature to an authentication middleware library. CodeRabbit has flagged a certain file as needing improvement, attaching this comment to the relevant lines in its review: + +> Consider using nested try-catch blocks here to handle different error scenarios more comprehensively. + +If this critique disagrees with your team's coding practices specific to try-catch blocks, then you can reply to this CodeRabbit using a comment of your own, addressed to the `@coderabbitai` service account on GitHub: + +> @coderabbitai Actually, we've found that nested try-catch blocks make our auth middleware harder to debug in production. We prefer early returns with specific error codes - it's cleaner and our monitoring tools can track them better. + +CodeRabbit considers your reply, and decides to make a learning out of it. It acknowledges this in another reply: + +> You're absolutely right about the debugging benefits. Early returns with specific error codes do provide better clarity and monitoring capabilities. I'll remember this preference for your authentication middleware. Thank you for the guidance! + +CodeRabbit also adds a **Learnings added** section to this comment, making explicit the fact that this chat has modified its future behavior with your team. + +CodeRabbit then creates a new learnings record for itself. Along with metadata such as the pull request number, filename, and GitHub user associated with the learning, CodeRabbit adds this self-instructive text to the new record: + +> In authentication middleware, prefer returning early with specific error codes rather than nested try-catch blocks. This improves readability and makes error tracking easier in production environments. + +### Best practices for new learnings {#best-practices} + +When communicating with CodeRabbit during an active code review, you can help make any resulting learnings more specific by replying directly to review comments that CodeRabbit has left on specific files, rather than leaving comments on the overall pull request. This gives CodeRabbit more context when considering feedback, allowing it to create more specific learnings. + +## View learnings {#view} + +To view the learnings that CodeRabbit has associated with your organization, +follow these steps: + +1. Visit [the CodeRabbit web interface](https://app.coderabbit.ai/settings/repositories). + +1. In the sidebar, click **Learnings**. + +This displays a paged list of all of the learnings associated with your organization, sorted by creation time, newest-first. To see more details about any learnings record, click its text. + +### Filter displayed learnings {#filter} + +Over time, the learnings that CodeRabbit gathers for your organization can become quite numerous. This can make manually browsing the full list difficult. The CodeRabbit web interface has search and filtering tools to help you find specific learnings, based on the topic of the learning text, or on other metadata. + +To filter the displayed learnings by topic or concept, enter that topic or concept into the **Similarity search** field, and set **Top K** to the number of results you want returned. Because this is a vector-based similarity search, the returned learnings don't necessarily contain the exact text of your search terms. + +For example, to see the top ten learnings that have to do with error reporting, enter `error reporting` into **Similarity search** and set **Top K** to `10`. + +To filter the displayed learnings by repository, user, or file path, click **+ Filters**, and select additional criteria. + +### Edit or delete learnings {#edit} + +If your account has the **Admin** [CodeRabbit role](/guides/roles) with your organization, then you can freely edit the text of any stored learning, or delete it outright. + +To edit or delete a learning, follow these steps: + +1. Click the **Action** menu on the learning record, which resembles three dots. + +1. Select **Edit** or **Delete**. + +## Configure learnings storage and application {#configure} + +CodeRabbit has several configuration options that modify the storage and application of learnings. + +### Opt out of learnings storage {#opt-out} + +CodeRabbit enables learnings by default. To disable learnings, modify one of the following configuration options: + +- To disable all CodeRabbit [knowledge base](/integrations/knowledge-base) features for your organization or repository, which includes learnings, enable [the _Opt out_ setting](/reference/configuration#opt-out). + +- To disable all CodeRabbit features that require long-term data retention about your organization's use of CodeRabbit—including learnings—disable [the _Data retention_ setting](/reference/configuration#data-retention). + +:::warning +Disabling data retention immediately and irrevocably deletes all learnings that CodeRabbit has associated with your organization. +::: + +### Specify the scope of applied learnings {#scope} + +[The Learnings configuration setting](/reference/configuration#learnings) lets you specify the _scope_ that CodeRabbit applies to all +of the learnings it has collected about your organization. You can set this option to one of the +following values: + +- **`auto`**: When reviewing a public repository, CodeRabbit applies only the learnings specific to that repository. When reviewing private repository, CodeRabbit applies all of your organization's learnings. This is the default setting. +- **`global`**: CodeRabbit applies all of your organization's learnings to all code reviews. +- **`local`**: CodeRabbit applies only learnings associated with code reviews' respective repositories. + +## What's next {#whats-next} + +- [Add review instructions](/guides/review-instructions) diff --git a/docs/guides/ondemand-reports.md b/docs/guides/ondemand-reports.md index 41dbe9bb..49214e32 100644 --- a/docs/guides/ondemand-reports.md +++ b/docs/guides/ondemand-reports.md @@ -1,5 +1,5 @@ --- -title: Generate reports +title: Generate reports on demand description: CodeRabbit offers a way to generate on-demand reports using a simple API request --- @@ -12,13 +12,9 @@ import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; ## Overview -CodeRabbit's reporting feature helps you track and analyze pull request activity across your repositories. There are two ways to generate reports: +This page is about using the CodeRabbit API to generate on-demand reports about your organization's usage of CodeRabbit. For a conceptual overview of reports in CodeRabbit, see [Generate reports](/guides/reports-overview). -1. **[Scheduled Reports](./scheduled-reports.md)** - Set up automated recurring reports that are delivered on a schedule to your preferred channels (email, Slack, MS Teams). This is the recommended way to keep your team informed about development progress. - -2. **On-demand Reports** (this guide) - Generate reports programmatically through our API when you need them. This is useful for integration with your own tools and workflows. - -If you're new to CodeRabbit's reporting features, we recommend starting with [Scheduled Reports](./scheduled-reports.md) to understand the available options and capabilities. +If you're new to CodeRabbit's reporting features, then we recommend starting with [Scheduled reports](/guides/scheduled-reports) to understand the available options and capabilities. In almost every scenario we recommend using the **Scheduled Reports** option. The **On-demand Report** does not have any additional benefits from the **Scheduled Reports** and has many limitations. ## API Access @@ -73,3 +69,8 @@ The on-demand report generation endpoints take in inputs as per the schema shown ``` [API Reference](https://api.coderabbit.ai/api/swagger/) + +## What's next + +- [Customize reports](/guides/custom-reports) +- [Scheduled reports](/guides/scheduled-reports) diff --git a/docs/guides/organization-settings.md b/docs/guides/organization-settings.md new file mode 100644 index 00000000..5b00d77d --- /dev/null +++ b/docs/guides/organization-settings.md @@ -0,0 +1,30 @@ +--- +title: Set your organization preferences +description: Learn the basics of configuring CodeRabbit for your organization. +--- + +This page is about managing the default settings of CodeRabbit across your +whole Git platform organization. + +For a general overview of configuring CodeRabbit, see [Configure CodeRabbit](/guides/configuration-overview). + +## About organization settings {#about} + +You can use the CodeRabbit web interface to set the CodeRabbit configuration +for all of the Git repositories associated with your organization. By default, all of your repositories apply your organization's CodeRabbit configuration. + +You have the option to define separate settings for some or +all of your individual repositories, instead. For more information, see [Set your repository preferences](/guides/repository-settings). + +## Browse and modify your organization settings {#modify} + +To view or modify your organizational settings, follow these steps: + +1. Visit [the CodeRabbit web interface](https://app.coderabbit.ai/settings/repositories). +1. In the sidebar, click **Organization Settings** > **Configuration**. +1. Browse and modify the settings as needed. If you do make changes, click **Apply Changes** when you are finished. + +## What's next {#whats-next} + +- [Initial configuration guide](/guides/initial-configuration) +- [Configuration best practices](/guides/setup-best-practices#configuration) diff --git a/docs/guides/reports-overview.md b/docs/guides/reports-overview.md new file mode 100644 index 00000000..5095364f --- /dev/null +++ b/docs/guides/reports-overview.md @@ -0,0 +1,38 @@ +--- +title: Generate reports +description: Learn about CodeRabbit's reporting capabilities, including scheduled and on-demand reports, and how to customize them +sidebar_label: Overview +--- + +```mdx-code-block +import ReportSchema from "@site/src/components/ReportSchema"; +import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; + + +``` + +You can track and analyze pull request activity across your organization's repositories by using the CodeRabbit reporting feature. + +## Scheduled and on-demand reports {#types} + +There are two ways to generate reports: + +- **[Scheduled Reports](/guides/scheduled-reports)**: Set up automated, recurring reports that are delivered to your team on a set schedule. **Use this option if you want to adjust your settings and send a report more than once**. Supported delivery channels include the following: + + - Email + - Discord + - Slack + - Teams + +- **[On-demand Reports](/guides/ondemand-reports)**: If you want to test a report format and produce a single report once, try the "On-demand Reports" Option. You can also generate reports programmatically through our API, but we do not recommend this as the API reporting is in beta. If you want to run an **On-demand Report** more than once then you must use the **Scheduled Reports** option. + +In almost every scenario we recommend using the **Scheduled Reports** option. The **On-demand Report** does not have any additional benefits from the **Scheduled Reports** and has many limitations. + +## Customize reports using natural language {#customize} + +For both scheduled and on-demand reports, you define the shape and content of your reports by providing a prompt that instructs CodeRabbit about report that you want, using natural language. The scheduled reports interface includes several example prompts that you can choose from, or you can write your own prompt. For more information, see [Customize reports](/guides/custom-reports). + +## What's next {#whats-next} + +- [Schedule reports](/guides/scheduled-reports) +- [Generate reports on demand](/guides/ondemand-reports) diff --git a/docs/guides/repository-settings.md b/docs/guides/repository-settings.md new file mode 100644 index 00000000..34ca9d56 --- /dev/null +++ b/docs/guides/repository-settings.md @@ -0,0 +1,43 @@ +--- +title: Set your repository preferences +description: Learn the basics of configuring CodeRabbit for your repository. +--- + +This page is about managing the settings of CodeRabbit for your +Git repository. For a general overview of configuring CodeRabbit, see [Configure CodeRabbit](/guides/configuration-overview). + +## About repository settings {#about} + +CodeRabbit provides two ways to manage its code-review behavior with each of your organization's repositories: + +- Add a `.coderabbit.yaml` file to your repository. +- View or modify your per-repository settings using the CodeRabbit web interface. + +If your repository contains a `.coderabbit.yaml` file at the top level of its default branch, +then CodeRabbit applies all of its settings to that repository's code reviews. CodeRabbit applies its own default values to any configuration settings not defined by your `.coderabbit.yaml` file. + +If your repository doesn't have a `.coderabbit.yaml` file, then CodeRabbit applies the configuration from the CodeRabbit web interface, instead. + +While the web interface provides an easier way to explore the available configuration options for your repository, we recommend using a `.coderabbit.yaml` file [as a best practice](/guides/setup-best-practices#yaml). + +## Configure your repository with `.coderabbit.yaml` + +To add a `.coderabbit.yaml` file to your repository, merge a copy of [our template configuration file](/reference/yaml-template) +to the top level of your default branch. From there, you can update your repository's CodeRabbit configuration by updating the `.coderabbit.yaml` file exactly as you would any other text file in your repository. + +For more information about the `.coderabbit.yaml` file, see [Add a configuration file](/getting-started/configure-coderabbit). + +## Browse and modify your settings using the web interface {#modify} + +To view or modify your repository settings using the CodeRabbit web interface, follow these steps: + +1. Visit [the CodeRabbit web interface](https://app.coderabbit.ai/settings/repositories). +1. In the sidebar, click **Repositories**. +1. Click the gear-shaped **Settings** icon of the repository whose settings you want to view or modify. +1. If the **Use Organization Settings** toggle is on, then click it to turn it off. If you leave it on, then CodeRabbit applies the settings you have set through [the organization-configuration page](/guides/organization-settings) to this repository. +1. Browse and modify the settings as needed. If you do make changes, click **Apply Changes** when you are finished. + +## What's next {#whats-next} + +- [Initial configuration guide](/guides/initial-configuration) +- [Configuration best practices](/guides/setup-best-practices#configuration) diff --git a/docs/guides/review-instructions.md b/docs/guides/review-instructions.md index c44b862c..d74024de 100644 --- a/docs/guides/review-instructions.md +++ b/docs/guides/review-instructions.md @@ -19,6 +19,225 @@ instructions besides the standard review. > For example, you may want to enforce a style guide by file types or directories. +### Default Blocked Paths + +By default, CodeRabbit blocks certain file paths and extensions from being reviewed. If you want CodeRabbit to review any of these blocked paths, you can explicitly include them in your Path Filters configuration. + +
+View complete list of default blocked paths + +The following paths are blocked by default, grouped by category: + +#### Build and Dependency Directories + +| Path Pattern | Description | +| --------------------- | -------------------------- | +| `!**/dist/**` | Build output directory | +| `!**/node_modules/**` | Node.js dependencies | +| `!**/.svelte-kit/**` | SvelteKit build directory | +| `!**/.webpack/**` | Webpack build directory | +| `!**/.yarn/**` | Yarn cache directory | +| `!**/.docusaurus/**` | Docusaurus build directory | +| `!**/.temp/**` | Temporary files directory | +| `!**/.cache/**` | Cache directory | +| `!**/.next/**` | Next.js build directory | +| `!**/.nuxt/**` | Nuxt.js build directory | + +#### Lock Files + +| Path Pattern | Description | +| ----------------------- | ------------------ | +| `!**/package-lock.json` | npm lock file | +| `!**/yarn.lock` | Yarn lock file | +| `!**/pnpm-lock.yaml` | pnpm lock file | +| `!**/bun.lockb` | Bun lock file | +| `!**/*.lock` | Generic lock files | + +#### Generated Code + +| Path Pattern | Description | +| ---------------------- | -------------------------------------- | +| `!**/generated/**` | Generated code directory | +| `!**/@generated/**` | Generated code directory (alternative) | +| `!**/__generated__/**` | Generated code directory (alternative) | +| `!**/__generated/**` | Generated code directory (alternative) | +| `!**/_generated/**` | Generated code directory (alternative) | +| `!**/gen/**` | Generated code directory (alternative) | +| `!**/@gen/**` | Generated code directory (alternative) | +| `!**/__gen__/**` | Generated code directory (alternative) | +| `!**/__gen/**` | Generated code directory (alternative) | +| `!**/_gen/**` | Generated code directory (alternative) | + +#### Binary and Compiled Files + +| Path Pattern | Description | +| ------------- | ----------------------- | +| `!**/*.app` | Application bundle | +| `!**/*.bin` | Binary file | +| `!**/*.class` | Java compiled class | +| `!**/*.dll` | Windows dynamic library | +| `!**/*.dylib` | macOS dynamic library | +| `!**/*.exe` | Windows executable | +| `!**/*.o` | Object file | +| `!**/*.so` | Shared object file | +| `!**/*.wasm` | WebAssembly file | + +#### Archives and Compressed Files + +| Path Pattern | Description | +| ------------ | ----------------------- | +| `!**/*.bz2` | Bzip2 archive | +| `!**/*.gz` | Gzip archive | +| `!**/*.xz` | XZ archive | +| `!**/*.zip` | ZIP archive | +| `!**/*.7z` | 7-Zip archive | +| `!**/*.rar` | RAR archive | +| `!**/*.zst` | Zstandard archive | +| `!**/*.tar` | TAR archive | +| `!**/*.jar` | Java archive | +| `!**/*.war` | Web application archive | +| `!**/*.nar` | NAR archive | + +#### Media Files + +| Path Pattern | Description | +| ------------ | --------------- | +| `!**/*.mp3` | MP3 audio | +| `!**/*.wav` | WAV audio | +| `!**/*.wma` | WMA audio | +| `!**/*.mp4` | MP4 video | +| `!**/*.avi` | AVI video | +| `!**/*.mkv` | MKV video | +| `!**/*.wmv` | WMV video | +| `!**/*.m4a` | M4A audio | +| `!**/*.m4v` | M4V video | +| `!**/*.3gp` | 3GP video | +| `!**/*.3g2` | 3G2 video | +| `!**/*.rm` | RealMedia video | +| `!**/*.mov` | QuickTime video | +| `!**/*.flv` | Flash video | +| `!**/*.swf` | Flash animation | +| `!**/*.flac` | FLAC audio | +| `!**/*.ogg` | OGG audio | + +#### Images and Fonts + +| Path Pattern | Description | +| ------------- | ---------------------- | +| `!**/*.ico` | Icon file | +| `!**/*.svg` | SVG image | +| `!**/*.jpeg` | JPEG image | +| `!**/*.jpg` | JPEG image | +| `!**/*.png` | PNG image | +| `!**/*.gif` | GIF image | +| `!**/*.bmp` | BMP image | +| `!**/*.tiff` | TIFF image | +| `!**/*.webm` | WebM image | +| `!**/*.ttf` | TrueType font | +| `!**/*.otf` | OpenType font | +| `!**/*.woff` | Web Open Font Format | +| `!**/*.woff2` | Web Open Font Format 2 | +| `!**/*.eot` | Embedded OpenType font | + +#### Documents and Data Files + +| Path Pattern | Description | +| --------------- | ----------------------- | +| `!**/*.pdf` | PDF document | +| `!**/*.doc` | Word document | +| `!**/*.docx` | Word document | +| `!**/*.xls` | Excel spreadsheet | +| `!**/*.xlsx` | Excel spreadsheet | +| `!**/*.ppt` | PowerPoint presentation | +| `!**/*.pptx` | PowerPoint presentation | +| `!**/*.csv` | CSV data file | +| `!**/*.tsv` | TSV data file | +| `!**/*.dat` | Data file | +| `!**/*.db` | Database file | +| `!**/*.parquet` | Parquet data file | + +#### Development and System Files + +| Path Pattern | Description | +| -------------------- | ------------------- | +| `!**/tags` | Tags file | +| `!**/.tags` | Tags file | +| `!**/TAGS` | Tags file | +| `!**/.TAGS` | Tags file | +| `!**/.DS_Store` | macOS system file | +| `!**/.cscope.files` | Cscope files | +| `!**/.cscope.out` | Cscope output | +| `!**/.cscope.in.out` | Cscope input/output | +| `!**/.cscope.po.out` | Cscope output | +| `!**/*.log` | Log file | +| `!**/*.map` | Source map | +| `!**/*.out` | Output file | +| `!**/*.sum` | Checksum file | +| `!**/*.work` | Work file | +| `!**/*.md5sum` | MD5 checksum file | + +#### Game and 3D Assets + +| Path Pattern | Description | +| ------------------- | ---------------------- | +| `!**/*.tga` | Targa image | +| `!**/*.dds` | DirectDraw surface | +| `!**/*.psd` | Photoshop document | +| `!**/*.fbx` | FBX 3D model | +| `!**/*.obj` | OBJ 3D model | +| `!**/*.blend` | Blender file | +| `!**/*.dae` | COLLADA 3D model | +| `!**/*.gltf` | GL Transmission Format | +| `!**/*.hlsl` | HLSL shader | +| `!**/*.glsl` | GLSL shader | +| `!**/*.unity` | Unity scene | +| `!**/*.umap` | Unreal map | +| `!**/*.prefab` | Unity prefab | +| `!**/*.mat` | Material file | +| `!**/*.shader` | Shader file | +| `!**/*.shadergraph` | Shader graph | +| `!**/*.sav` | Save file | +| `!**/*.scene` | Scene file | +| `!**/*.asset` | Asset file | + +#### Python-specific Files + +| Path Pattern | Description | +| -------------- | --------------------- | +| `!**/*.pyc` | Python compiled file | +| `!**/*.pyd` | Python dynamic module | +| `!**/*.pyo` | Python optimized file | +| `!**/*.pkl` | Python pickle file | +| `!**/*.pickle` | Python pickle file | + +#### Go-specific Files + +| Path Pattern | Description | +| ---------------- | ------------------------------- | +| `!**/*.pb.go` | Protocol buffer Go file | +| `!**/*.pb.gw.go` | Protocol buffer gateway Go file | + +#### Terraform Files + +| Path Pattern | Description | +| ---------------------- | ---------------------- | +| `!**/*.tfstate` | Terraform state file | +| `!**/*.tfstate.backup` | Terraform state backup | + +#### Minified Files + +| Path Pattern | Description | +| ------------------ | ------------------------------ | +| `!**/*.min.js` | Minified JavaScript | +| `!**/*.min.js.map` | Minified JavaScript source map | +| `!**/*.min.js.css` | Minified CSS | + +
+ +You can also edit your path filters directly in the UI by navigating to: **Configuration** > **Review** > **Settings** > **Path Filters** + +CircleCI Integration + ### Sample Usage :::note diff --git a/docs/guides/roles.md b/docs/guides/roles.md new file mode 100644 index 00000000..c919f57d --- /dev/null +++ b/docs/guides/roles.md @@ -0,0 +1,138 @@ +--- +title: Control administrative access +description: Using the role-based authorization features of CodeRabbit +--- + +You can control which CodeRabbit +administrative features are available to your organization's user accounts by +assigning and updating account roles. + +## Overview of CodeRabbit roles {#overview} + +Every CodeRabbit account has exactly one role for each organization +that account is associated with. +For example, if you belong to two GitHub-based organizations that use +CodeRabbit, then you have one CodeRabbit role set for each of those two +organizations. + +CodeRabbit roles determine your ability to read or change various +billing, account management, and other administrative functions related to +an organization. The roles are as follows: + +- **Admin**: allows full read/write access to all CodeRabbit administrative features. +- **Member**: allows read-only access to a limited set of administrative settings. This role + is appropriate for most developers in an organization. +- **Billing Admin**: allows read/write access to features specific + to a subscription and billing management, and limited access to other administrative features. + +CodeRabbit users with the **Admin** role can modify the roles of other users in the +organization. + +For a complete list of the administrative functions available to each role, see +[Role permissions](#permissions). + +### CodeRabbit roles and Git platform roles {#and-upstream} + +Modifying an account's CodeRabbit role doesn't have any "upstream" +effect on that account's role or permissions in your organization's Git platform. +Similarly, changes to an account's role on your organization's Git platform don't +affect that account's CodeRabbit role. + +For example, if you have CodeRabbit integrated with a GitHub organization, and you change an account's CodeRabbit role from **Member** to **Admin**, then that account's +permission or ownership level with your GitHub organization doesn't change as a result. + +### CodeRabbit roles and developer features {#and-features} + +CodeRabbit roles affect only access to administrative features. Roles have no effect on using CodeRabbit developer features, such as automated code reviews. + +For example, if an organization has a Pro-tier +CodeRabbit account, then any user account with a seat assigned to it can use Pro-tier features with the organization's private repositories, regardless of that account's role. + +For more information on seat and subscription management, see [Manage your subscription](/getting-started/subscription-management). + +## Default roles {#defaults} + +CodeRabbit assigns every user account in your organization a default role, +using the following metrics: + +- If a user has an ownership-level role with the Git platform organization—for example, + **Admin** on GitHub, or **Owner** on Bitbucket—then that user receives the default + CodeRabbit role of **Admin**. +- Otherwise, the user receives the **Member** role by default. + +You can update a user's role from its default setting by following the steps detailed in the next section. This requires that your own account +has an **Admin** role with the organization. + +CodeRabbit applies these defaults only when initially setting up for an +account within an organization. Subsequent "upstream" role changes don't affect +an account's CodeRabbit role. + +## View or set roles {#how-to} + +You can view and set roles from the CodeRabbit dashboard, as detailed in the +following sections. + +### View roles {#view-roles} + +To view a list of your organization's role assignments, follow these steps: + +1. Go to the [CodeRabbit dashboard](https://app.coderabbit.ai/settings/repositories). +1. At the top of the sidebar, select the organization whose user roles you want to view. +1. On the sidebar, click **Subscription**. + +This displays a table of all of the CodeRabbit **Admin** and **Member** accounts associated with the selected +organization. In this table, the **Role** column displays the CodeRabbit role for +each account. + +To view a list of accounts with the **Billing Admin** role, click the **Billing Admins** tab located above the table of user accounts. + +### Set roles {#set-roles} + +:::note +To modify users' CodeRabbit accounts, your own account must have the **Admin** role within your organization. +::: + +To change a user account's CodeRabbit role, follow these steps: + +1. Go to your organization's list of user accounts, as detailed in the previous section. + If you have the **Admin** role within this organization, then the **Role** column in the user accounts table contains selectable menus. +1. Click the menu in the user's **Role** column, and select the appropriate role from + the list. + +The only roles you can assign through this method are **Admin** and **Member**. +You can't grant the **Billing Admin** role to an existing user account. To add an account with the **Billing Admin** role, see the next section. + +### Add billing admin accounts {#billing} + +:::note +Billing Admin users don't require CodeRabbit seat licenses. You can add Billing Admin users regardless of how many seat licenses you have available. +::: + +To add a CodeRabbit user account with the **Billing Admin** role, follow these steps: + +1. Go to your organization's list of user accounts, as detailed in [View roles](#view-roles). +1. Click **Invite Billing Admin**. +1. Enter the name and email address of the billing administrator who you want to invite to the organization. + +This sends an email to the address that you specified. After the recipient completes the process of joining your organization in CodeRabbit, then their record appears in the user accounts list, under the **Billing Admins** tab. + +## Role permissions {#permissions} + +The following table lists the CodeRabbit administrative functionality +available to each of the CodeRabbit roles. + +| Resource | Admin | Member | Billing Admin | +| ----------------------- | ---------- | --------- | ------------- | +| Learning Resources | Read/Write | Read-only | No access | +| Metrics/Dashboard | Read/Write | No access | No access | +| Reports | Read/Write | Read-only | No access | +| Integrations | Read/Write | Read-only | No access | +| Repository Settings | Read/Write | Read-only | No access | +| Organization Settings | Read/Write | Read-only | No access | +| User Management | Read/Write | Read-only | Read-only | +| Subscription Management | Read/Write | Read-only | Read/Write | +| Billing Management | Read/Write | No access | Read/Write | + +## What's next {#whats-next} + +- [Manage your subscription](/getting-started/subscription-management) diff --git a/docs/guides/scheduled-reports.md b/docs/guides/scheduled-reports.md index 44a11f56..cef41d46 100644 --- a/docs/guides/scheduled-reports.md +++ b/docs/guides/scheduled-reports.md @@ -11,6 +11,8 @@ import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; CodeRabbit Pro offers automated recurring reports that provide insights into your GitHub organization's activities. These reports can be customized and delivered through various channels to help teams stay informed about development progress. +For a conceptual overview of reports in CodeRabbit, see [Generate reports](/guides/reports-overview). + ## Setting Up a Recurring Report 1. Navigate to **Recurring Reports** in the [CodeRabbit dashboard](https://app.coderabbit.ai/reports/recurring) @@ -50,11 +52,12 @@ Choose a time that works for all team members, especially for distributed teams ### Report Parameters -Reports can be filtered using multiple parameters: +Reports can be filtered using multiple parameters, match pull requests using the **IN** option and exclude pull requests using the **NOT_IN** option: - **Repositories**: Select specific repositories to monitor - **Labels**: Filter by GitHub labels with operators: - IN: Match any selected label + - NOT_IN: Exclude any pr with select label - ALL: Match all selected labels - **Users**: Filter by specific GitHub users - **Teams**: Filter by organization teams @@ -248,3 +251,8 @@ Deleting a report will immediately stop all scheduled runs and remove access to - [Custom Reports](./custom-reports.md) - [On-demand Reports](./ondemand-reports.md) - [API Documentation](https://api.coderabbit.ai/api/swagger/) + +## What's next + +- [Customize reports](/guides/custom-reports) +- [Generate reports on demand](/guides/ondemand-reports) diff --git a/docs/guides/setup-best-practices.md b/docs/guides/setup-best-practices.md new file mode 100644 index 00000000..0533da5e --- /dev/null +++ b/docs/guides/setup-best-practices.md @@ -0,0 +1,131 @@ +--- +title: "Setup and configuration best practices" +description: Best practices for setting up CodeRabbit. +sidebar_label: Setup and configuration +--- + +This page contains our best-practice advice for setting up CodeRabbit, and then +configuring its code review behavior. + +## Setup best practices {#setup} + +This section lists our recommendations for setting up CodeRabbit with your +Git platform, and integrating CodeRabbit with other tools and services. + +### Give CodeRabbit its own user account {#user} + +CodeRabbit works best when it has a user account all to itself on your Git platform. +Your team treats this account as a bot or service account—even on platforms that don't +have a formal concept of separate service accounts, such as Bitbucket Cloud. + +If you use GitHub, then CodeRabbit sets up a service account named `CodeRabbitAI` for you as soon as you connect your GitHub organization to CodeRabbit. On other platforms, such as Bitbucket Cloud or Gitlab, you must set this account up yourself. + +For platform-specific instructions about setting up this user, see +[Integrate with Git platforms](/platforms/). + +### Let CodeRabbit read your issue tracker {#issues} + +CodeRabbit can report on whether the changes proposed by a pull request +successfully address specific, ticketed issues referenced by that pull request. + +For this to work, CodeRabbit needs read access to your team's issue management system. + +If you use the built-in issue management of either GitHub or GitLab, then +CodeRabbit issue integration works without any further setup. + +If you use issue management systems external from your Git platform, then you need to +take additional steps to integrate CodeRabbit with your team's issues. + +These are the external issue management systems that CodeRabbit supports: + +- Jira +- Linear + +For more information, see [Integrate issue tracking](/integrations/issue-integrations/). + +### Set up basic reports for your team {#reports} + +CodeRabbit has a flexible reporting feature that can help keep your whole team +up-to-date about the latest changes to your repositories. We recommend setting +up at least the following scheduled reports, using templates available +through the CodeRabbit web interface: + +- A daily standup report, grouped by contributor. +- Regular release notes, grouped by repository. + +For more information, see [Generate reports](/guides/reports-overview). + +## Configuration best practices {#configuration} + +This section lists our recommendations for configuring the way that CodeRabbit +works with your individual repositories. + +### Fine-tune reviews using YAML files {#yaml} + +CodeRabbit gives you two ways to configure how it works with your team's repositories: + +- The **Organization Settings** and **Repositories** pages of [the + CodeRabbit web interface](https://app.coderabbit.ai/login) +- A [`.coderabbit.yaml` file](/getting-started/configure-coderabbit/) in your repository + +The web interface lets you set up your organization's code review +preferences rapidly, and can help you get familiar with CodeRabbit configuration options. + +We recommend adding a `.coderabbit.yaml` file to repositories, as well. Using this file has several advantages over using only the web interface: + +- It applies version control to your repository's CodeRabbit settings, letting you track changes, view configuration history, and revert to previous configurations as needed. +- During code reviews, CodeRabbit loads the file along with rest of your repository. This means that you can include setting changes as part of a pull request, and CodeRabbit both analyzes and applies these settings during its review. +- The file makes the repository's CodeRabbit settings transparent to all of the repository's contributors. + +Repository-level settings defined by a `.coderabbit.yaml` take precedence over the +settings defined for that repository or for your organization using the CodeRabbit web interface. + +For more information, see [Add a configuration file](/getting-started/configure-coderabbit/). + +### Speed up reviews by adding path filters {#filters} + +If your repository contains a lot of data or other content that CodeRabbit +doesn't need for code review context, then you can include _path filters_ in +your repository configuration. For example, a filter of `!dist/**` tells CodeRabbit +to disregard everything in your repository's top-level `dist` directory when +preparing a code review. + +Reducing the number of contextual files that CodeRabbit needs to read and analyze +when preparing a code review can help make its code reviews faster. + +You can define path filters using the CodeRabbit +web interface, or with [a `.coderabbit.yaml` file](/getting-started/configure-coderabbit/). + +### Trust the defaults {#defaults} + +CodeRabbit gives you control over a number of its core code-review features, letting you deactivate them entirely for your repositories if needed. We have chosen the default settings to meet the needs of most organizations and situations, and recommend leaving these settings at their default values if possible: + +- **Cache**: Keep [the cache](/reference/caching) enabled to let CodeRabbit temporarily remember details about your repository + between reviews, which improves review speed. +- **Tools**: By default, CodeRabbit is allowed to use all of the [open-source linters and analyzer + tools](/tools) that are available to it during code reviews. This helps CodeRabbit keep its reviews broad and flexible. +- **Knowledge base**: CodeRabbit [knowledge base](/integrations/knowledge-base/) features, including learnings and issue tracking, can require data retention. If your organization needs to meet stricter data-retention policies, then you can opt out of using these features. + +You can configure your use of the above features using the CodeRabbit web interface, or [a `.coderabbit.yaml` file](/getting-started/configure-coderabbit/). + +### Write specific CI/CD error messages {#pipeline} + +CodeRabbit can analyze the logs of continuous integration (CI) or continuous +deployment (CD) tools in your pipeline. CodeRabbit can provide better remediation +advice about CI/CD failures during code reviews if your tools' error messages +are as specific as possible when reporting failures. + +For CodeRabbit to provide the best advice, configure your CI/CD failure output to include the following information: + +- File names associated with the failure. +- Line numbers that identify where the failure occurred in those files. +- An explanation of the failure, including relevant error codes or diffs. + +[This pull request](https://github.com/ff14-advanced-market-search/temp-fe/pull/47/files) shows an example of expanding the context of a CI error, +in this case including a diff to show why a code-formatter check failed. + +--- + +## What's next {#whats-next} + +- [Code review best practices](/guides/code-review-best-practices) diff --git a/docs/guides/use-vscode-selfhosted.md b/docs/guides/use-vscode-selfhosted.md new file mode 100644 index 00000000..4452ad8d --- /dev/null +++ b/docs/guides/use-vscode-selfhosted.md @@ -0,0 +1,29 @@ +--- +title: Use with self-hosted CodeRabbit +description: How to setup the VSCode extension with self-hosted CodeRabbit +--- + +This page is about setting up the VSCode extension with self-hosted CodeRabbit. If you are instead using the managed offering, see [Install the VSCode extension](/guides/install-vscode). + +## Prerequisites + +1. Your extension version should be greater than `0.12.1`. +2. Logout of the extension if previously logged in. + +## Connect your self-hosted instance{#connect-self-hosted-instance} + +To connect the VSCode extension to your self-hosted instance, follow these steps: + +1. Click on the "Self hosting CodeRabbit?" button, below the "Use CodeRabbit for free" button. +2. Enter your self-hosted instance URL when prompted. + - Make sure the instance URL is reachable within your network and websocket connections are allowed. +3. Select your git provider which you are using with your self-hosted CodeRabbit. (GitLab, Self-Hosted Gitlab, GitHub, GitHub Enterprise) + - If using GitHub or GitHub Enterprise, enter your [Github Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) when prompted. + +You should be connected to your self-hosted instance and ready to use the VSCode extension. + +## What's next {#whats-next} + +- [Use the VSCode extension](/guides/use-vscode) +- [Configure the VSCode extension](/guides/config-vscode) +- [Uninstall the VSCode extension](/guides/uninstall-vscode) diff --git a/docs/guides/use-vscode.md b/docs/guides/use-vscode.md index bfacd87b..169dc2a8 100644 --- a/docs/guides/use-vscode.md +++ b/docs/guides/use-vscode.md @@ -18,7 +18,7 @@ You can let CodeRabbit automatically review commits that you make to your local 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. Perform a Git commit using VSCode or terminal. 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. diff --git a/docs/integrations/knowledge-base.md b/docs/integrations/knowledge-base.md index 61ff141e..24b2d1be 100644 --- a/docs/integrations/knowledge-base.md +++ b/docs/integrations/knowledge-base.md @@ -1,5 +1,5 @@ --- -title: Apply your code review preferences +title: Knowledge base overview description: Learn about CodeRabbit's internal knowledge base and its integrations with external services. --- @@ -17,8 +17,25 @@ For example, you can add a comment in a PR to chat directly with CodeRabbit. `@c Or you can comment directly on some lines of code in the PR. `@coderabbitai do not complain about lack of error handling here, it is handled higher up the execution stack.` -:::tip Video Tutorial +For more information, see [Teach CodeRabbit your review preferences](/guides/learnings). -Watch our [video walkthrough on learnings](https://www.youtube.com/watch?v=Yu0cmmOYA-U) for more information. +## Code Guidelines {#code-guidelines} -::: +CodeRabbit can read _code guideline_ files that set standards and expectations about +your team's coding practices, described in natural language. CodeRabbit applies any instructions it reads from a repository's code guideline files to all subsequent code reviews. + +By default, CodeRabbit looks for and loads guideline files used by other AI coding assistants, including the following: + +- Claude Code +- Cursor +- Gemini +- GitHub Copilot +- Windsurf + +You can also mark any other file +or set of files in your repository as code guidelines by providing CodeRabbit with a list +of paths to those files. + +This feature is enabled by default; you can disable it if needed. + +For more information about configuring the code guidelines feature, see [Code guidelines](/reference/configuration#code-guidelines) in the configuration reference page. diff --git a/docs/overview/introduction.md b/docs/overview/introduction.md index 06150977..f937ac67 100644 --- a/docs/overview/introduction.md +++ b/docs/overview/introduction.md @@ -58,8 +58,8 @@ No matter how you tune and customize CodeRabbit, its default settings make it us CodeRabbit integrates in just a few clicks with many popular Git platforms: -- GitHub, including GitHub Enterprise Server -- GitLab, including self-managed GitLab +- GitHub, GitHub Enterprise Cloud, GitHub Enterprise Server, +- GitLab, GitLab Self-Managed - Azure DevOps - Bitbucket Cloud diff --git a/docs/overview/why-coderabbit.md b/docs/overview/why-coderabbit.md index cbdfc5f6..f04e347d 100644 --- a/docs/overview/why-coderabbit.md +++ b/docs/overview/why-coderabbit.md @@ -57,7 +57,7 @@ Your intelligent code review companion that understands context. > From its foundation as a Generative AI-first platform, CodeRabbit has evolved to become the preferred code review tool among developers because of its speed, intelligence, adaptability, and support for features like contextual analysis, security scanning, and architectural insights. CodeRabbit supports all major programming languages and integrates with popular development [tools](/tools). :::info Get Started -If your team needs intelligent code reviews, CodeRabbit delivers. If you're new to AI-powered reviews, [sign up for a Free account](https://app.coderabbit.ai/login), join the [Discord server](https://discord.gg/coderabbit), and start the journey with us. +If your team needs intelligent code reviews, CodeRabbit delivers. If you're new to AI-powered reviews, [sign up for a Free account](https://app.coderabbit.ai/login?free-trial), join the [Discord server](https://discord.gg/coderabbit), and start the journey with us. ::: ## CodeRabbit is Context-Aware @@ -432,9 +432,9 @@ Try CodeRabbit on your next pull request. Experience how AI-powered code review > Start reading more about the custom [code review instructions](/guides/review-instructions) or how CodeRabbit verify issues using [knowledge bases](/integrations/knowledge-base) like Linear and Jira. -Transform your code reviews now, [Start your free trial today](https://app.coderabbit.ai/login) and join the Discord server and chat with CodeRabbit users and team. +Transform your code reviews now, [Start your free trial today](https://app.coderabbit.ai/login?free-trial) and join the Discord server and chat with CodeRabbit users and team. diff --git a/docs/platforms/azure-devops.md b/docs/platforms/azure-devops.md index 12b70765..b88ebcd7 100644 --- a/docs/platforms/azure-devops.md +++ b/docs/platforms/azure-devops.md @@ -94,9 +94,8 @@ Follow these steps to generate the token: 5. Select the organization you want to use the token with or select "All accessible organizations." 6. Enter a name and an expiry date for the token. -7. We need to have read & write access to "Work Items" & "Code" to post reviews - on pull requests. If you are on the Pro tier also add "Build" access for pipeline - failure remediation. -8. Click "Create" +7. Grant **Read, write, & manage** access to "Work Items" and "Code". CodeRabbit needs these permissions to post code reviews on pull requests. +8. If you subscribe to CodeRabbit Pro, then you can also grant **Read** access to "Build" for pipeline failure remediation. +9. Click "Create" ![CodeRabbit azure devOps personal access token creation form](/img/integrations/azure-access-token.png) diff --git a/docs/platforms/bitbucket-cloud.md b/docs/platforms/bitbucket-cloud.md index acb37f34..385d46ed 100644 --- a/docs/platforms/bitbucket-cloud.md +++ b/docs/platforms/bitbucket-cloud.md @@ -13,89 +13,90 @@ CodeRabbit integrates with Bitbucket Cloud to enhance code review and collaborat This guide will assist you in effectively integrating CodeRabbit with Bitbucket Cloud. -## Configure App Password +## Configure API Token -To enable CodeRabbit to interact with your Bitbucket repositories, an app password is required. This token grants the necessary permissions for interacting with the Merge Requests and Discussions APIs. +To enable CodeRabbit to interact with your Bitbucket repositories, an API token is required. This token grants the +necessary permissions for interacting with the Bitbucket merge request and discussion APIs. 1. Create a new Bitbucket account specifically for CodeRabbit and treat it as a service account. 2. Name the account "CodeRabbit". -3. Generate an App Password to enable seamless integration between CodeRabbit and your Bitbucket repositories. +3. If your Bitbucket workspace requires two-step verification, then you must also enable two-step verification on this + new account. +4. Generate an API Token to enable seamless integration between CodeRabbit and your Bitbucket repositories. -We recommend creating a new user as a service account, associating this user to the workspace you'd like to install CodeRabbit on, and providing CodeRabbit with the app password to allow access. During the installation process, CodeRabbit will automatically configure the required webhook for seamless integration. - -
- Bitbucket user modal -
+We recommend creating a new user as a service account, associating this user to the workspace you'd like to install +CodeRabbit on, and providing CodeRabbit with the API token to allow access. During the installation process, CodeRabbit +will automatically configure the required webhook for seamless integration. :::note -If you wish to change the review user, you must provide the app password for the new user who will post reviews and comments. However, this requires manually removing the previous user from the projects and associated webhooks. Once this is done, you will need to reinstall the CodeRabbit app for each project. +If you wish to change the review user, you must provide the API token for the new user who will post reviews and +comments. However, this requires manually removing the previous user from the projects and associated webhooks. Once +this is done, you will need to reinstall the CodeRabbit app for each project. ::: ### Recommendations -- **Create a dedicated user for CodeRabbit** - This ensures the user is exclusively for CodeRabbit, allowing better access control. +- **Create a dedicated user for CodeRabbit** - This ensures the user is exclusively for CodeRabbit, allowing better + access control. - **Use "CodeRabbit" as the username** - This makes the user easily recognizable for future reference. - **Use a dedicated email address** - This helps in easy identification and 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"). -- **Developer Access** Ensure the service account user has developer access to the projects that you wish to install CodeRabbit on. +- **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"). +- **Developer Access** Ensure the service account user has developer access to the projects that you wish to install + CodeRabbit on. #### Key Points to Remember -- Code reviews will be attributed to the owner of the app password. +- Code reviews will be attributed to the owner of the API token. -#### Generating an App password +#### Generating an API token -Bitbucket provides an option to generate an app password for a new user. Follow these steps to generate the password: +Bitbucket provides an option to generate an API token for a new user. Follow these steps to generate the token: -1. Log in using the user designated for CodeRabbit reviews. This user serves as a service account for managing reviews and related activities. -2. Go to "Personal Bitbucket Settings". -3. Choose **App passwords**. -4. Click **Create app password**. -5. Enter a label easily recognizable for this app passwords usage. +1. Log in using the user designated for CodeRabbit reviews. This user serves as a service account for managing reviews + and related activities. +2. Go to [API Tokens](https://id.atlassian.com/manage-profile/security/api-tokens). +3. Click **Create API token with scopes**. +4. Enter a name easily recognizable for this API token usage and an expiration date based on your plan of using the + product. +5. On next step select **Bitbucket** 6. Ensure the following scopes are selected: - 1. Account - Read - 2. Issues - Write - 3. Workspace membership - Read - 4. Projects - Write - 5. Repositories - Write - 6. Pull requests - Write - 7. Webhooks - Read and write - 8. Pipelines - Read - 9. Runners - Read + - read:account + - read:user:bitbucket + - write:issue:bitbucket + - read:issue:bitbucket + - read:workspace:bitbucket + - admin:project:bitbucket + - write:webhook:bitbucket + - read:webhook:bitbucket + - read:pipeline:bitbucket + - read:runner:bitbucket + - read:repository:bitbucket + - write:repository:bitbucket + - read:pullrequest:bitbucket + - write:pullrequest:bitbucket 7. Click **Create** -8. Note down the app password as it will only be displayed once. - -
- Bitbucket app password configuration page -
-
- Bitbucket app password permissions -
+8. Note down the API token as it will only be displayed once. -### Where to Provide CodeRabbit the App Password +### Where to Provide CodeRabbit the API Token -By default, if no app password is provided, CodeRabbit will prompt you to provide one during the installation process. However, if you wish to provide the token beforehand, you can do so by navigating to the **Organization Settings** tab, and selecting the **Bitbucket User** tab on the sidebar. Once entering the app password, the password will be validated and saved for future use. +By default, if no API token is provided, CodeRabbit will prompt you to provide one during the installation process. +However, if you wish to provide the token beforehand, you can do so by navigating to the **Organization Settings** tab, +and selecting the **Bitbucket User** tab on the sidebar. Once entering the API token, the token will be validated and +saved for future use. -You can confirm the correct user is being selected by verifying the user ID shown on the UI with the user ID of the service account user you created. +You can confirm the correct user is being selected by verifying the user ID shown on the UI with the user ID of the +service account user you created. --- ### Installing CodeRabbit into your Bitbucket Repositories 1. Go to the [Repositories page](https://app.coderabbit.ai/settings/repositories) in the CodeRabbit app. -2. Select the checkbox next to the repositories where you want to install CodeRabbit. To install it on all repositories at once, select the checkbox at the top. +2. Select the checkbox next to the repositories where you want to install CodeRabbit. To install it on all repositories + at once, select the checkbox at the top. 3. Select **Install Repositories**.
@@ -120,10 +121,12 @@ The webhook `https://coderabbit.ai/bitbucketHandler` will now be installed for t :::note -If you are experiencing issues with the webhook, such as CodeRabbit not being able to access the repository, or not reviewing pull requests, you can manually delete the webhook to the repository. +If you are experiencing issues with the webhook, such as CodeRabbit not being able to access the repository, or not +reviewing pull requests, you can manually delete the webhook to the repository. Then refresh the repository page in the CodeRabbit app and you can reinstall the webhook. -If you cannot install the webhook please check that your Bitbucket user has the necessary permissions to install the webhook and the App Password is properly configured. +If you cannot install the webhook please check that your Bitbucket user has the necessary permissions to install the +webhook and the API Token is properly configured. ::: diff --git a/docs/platforms/github-com.md b/docs/platforms/github-com.md index ecc07272..c318307d 100644 --- a/docs/platforms/github-com.md +++ b/docs/platforms/github-com.md @@ -1,116 +1,110 @@ --- -title: Integrating CodeRabbit with GitHub.com +title: Integrate with GitHub.com description: Learn how to integrate CodeRabbit and add to your GitHub workflow. sidebar_label: GitHub.com -sidebar_position: 1 --- This is a step-by-step guide to integrate CodeRabbit with your GitHub repositories. -> **CodeRabbit** is an AI code reviewer designed to ease the challenges of code review, supporting repository maintainers and teams. It reviews your PRs and provides concise summaries, identifies potential issues, and offers insights that might be missed during manual reviews. +For an overview of how CodeRabbit integrates with Git platforms, see +[Add CodeRabbit to your repository](/platforms). -## How CodeRabbit Works? +For a hands-on tutorial with CodeRabbit performing code reviews on a live +GitHub repository that you create, see [Quickstart](/getting-started/quickstart). -> CodeRabbit integrates with GitHub, automating the code review process from the moment a pull request is created. +## Before you begin -It preprocesses the PR content, builds context, leverages Large Language Models for analysis, and then post-processes the AI response before posting the review back to GitHub. This streamlined workflow ensures thorough AI-powered code reviews without manual intervention. +You need to have a GitHub account, and ownership-level permissions of at least one repository associated with that account. -![How CodeRabbit Works](/img/integrations/how-codeRabbit-works.png) +If you want to authorize CodeRabbit to write code reviews for a repository contained in a GitHub organization, then you need ownership-level permission with that organization, as well. -## Let's Integrate CodeRabbit with GitHub +## Authorize CodeRabbit with your GitHub account -### 1. Accessing CodeRabbit +Before you can use CodeRabbit with GitHub, you need to +authorize CodeRabbit with your GitHub account. To do this, follow these steps: -Visit the [CodeRabbit login](https://app.coderabbit.ai/login?free-trial) page. You'll see all the authentication options, select "**Login with GitHub**" to proceed. +1. Visit [the CodeRabbit login page](https://app.coderabbit.ai/login). -![CodeRabbit Login](/img/integrations/login-self-hosted-github.png) +1. Click **Login with GitHub**. Your browser navigates to GitHub.com. -### 2. Authorization +1. If GitHub prompts to sign in to your GitHub account before continuing, then enter your GitHub login credentials as you normally would. Otherwise, continue to the next step. -When you choose **Login with GitHub** in step1, you'll be prompted to authorize CodeRabbit. +1. GitHub displays a summary of the information that CodeRabbit needs in order to integrate with your + GitHub account. This includes read-only access to the following: -> This step grants the necessary permissions for CodeRabbit to interact with your repositories and pull requests. + - Organizations and teams that are associated with your GitHub account. + - Email addresses that are associated with your GitHub account. -![Authorization Login](/img/integrations/authorization-codeRabbit.png) + To allow CodeRabbit access to this information, click **Authorize coderabbitai**. -### 3. Selecting Your Organization +After you complete these steps, your browser navigates to the CodeRabbit web interface. -Upon Authorization, If you're part of multiple organizations, you'll have the opportunity to choose which one you want to associate with CodeRabbit. This ensures that you're setting up the tool for the correct team or project. +Now that you've integrated CodeRabbit with your GitHub account, you need to give CodeRabbit additional permissions to work with your code repositories. To do this, see the next section. -![How to Select Organization in CodeRabbit](/img/integrations/select-organization.png) +## Allow CodeRabbit to access your repositories -### 4. Exploring the CodeRabbit Dashboard +Even after you've integrated CodeRabbit with your GitHub account, you need to +separately grant CodeRabbit the permissions that it needs to post code reviews and +create pull requests in your repositories. -Upon successful authorization, you'll be logged into the CodeRabbit user interface. +You need to authorize CodeRabbit separately for each GitHub organization whose repositories you want it to work with. You can give CodeRabbit permission to +work with all of the repositories associated with a GitHub organization, or limit its access to a select list. -Here, you can add repositories and configure CodeRabbit config settings for each repository. +### Overview of required permissions -![CodeRabbit Dashboard](/img/integrations/codeRabbit-dashboard.png) +CodeRabbit requires the following permissions to work with your repositories: -:::tip -If you opt to authorize all repositories during setup, CodeRabbit will automatically include any new repositories you create on GitHub in the future. This saves you the hassle of manual additions down the line. -::: - -### 5. CodeRabbit Configuration - -You can configure CodeRabbit through a YAML file or using the [App's UI](https://app.coderabbit.ai/login). +- Read-only access to actions, checks, discussions, members, and metadata. -You can tailor CodeRabbit's functionality using the `.coderabbit.yaml` file, which you place directly in your GitHub repository. This file mirrors the options available in the CodeRabbit user interface, with each setting in the YAML corresponding to a specific toggle in the UI. Configure CodeRabbit either through the coderabbit.yaml file or the interface, depending on your preference. +- Read-and-write access to code, commit statuses, issues, and pull requests. :::note - -If a `.coderabbit.yaml` file exists in your GitHub repository, it takes precedence over any UI settings. Choose either the YAML file or UI configuration - you don't need to use both. **Refer CodeRabbit YAML schema [here](https://storage.googleapis.com/coderabbit_public_assets/schema.v2.json)** - +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). ::: -Once your `.coderabbit.yaml` file is prepared according to your needs, simply place it in your GitHub repository, and you're all set — CodeRabbit is now integrated. - -> When a pull request is created targeting the master branch, CodeRabbit automatically initiates its review process. It analyzes the changes and generates a summary and walkthrough of the modifications. The specific feedback and analysis provided by CodeRabbit are determined by the options you've configured in your YAML file. - -Let's see a few examples of CodeRabbit's review comments from a specific pull request in one of the projects. - -This particular PR involved in changing the language model from LLaMA 2 to LLaMA 3, for testing purposes. These examples will showcase how CodeRabbit analyzed and commented on this significant model switch. - -## Sample PR Review Workflow using CodeRabbit - -CodeRabbit automatically generates a PR summary highlighting key changes. - -![CodeRabbit Summary](/img/integrations/summary-by-codeRabbit.png) +### Grant required permissions -This image shows CodeRabbit's review status for another pull request. It highlights that **12 actionable comments** were generated, and the review also includes additional comments on specific files, demonstrating CodeRabbit's comprehensive analysis of the code changes. +To give CodeRabbit access to one or more of your repositories, follow these steps: -![Actionable Comments By CodeRabbit](/img/integrations/actionable-comments-by-coderabbit.png) +1. Visit [the CodeRabbit web interface](https://app.coderabbit.ai/settings/repositories). -You can also use [CodeRabbit commands](https://docs.coderabbit.ai/guides/commands/) to chat with the AI code Reviewer. +1. Make sure that the correct GitHub organization for the repository is displayed + at the top of the web interface. To change the organization, click **Change + Organization** and select a different organization from the list. -![CodeRabbit Commands](/img/integrations/full-review.png) + If the repositories that you want to add are associated directly with your GitHub account, and not a separate organization, then select your account name as the organization. -CodeRabbit could generate a **code sequence diagram** when you request a full review. + If the organization containing the repository doesn't appear in the list, then you might + need to refresh the list of organizations that CodeRabbit has associated with your + GitHub account. For more information, see [Add organizations](/getting-started/adding-organizations). -The sequence diagram illustrates the precise flow of interactions between the objects in the system. +1. Click the **Add Repositories** button. Your browser navigates to GitHub.com. -![CodeRabbit Sequence Diagram](/img/integrations/coderabbit-sequence-diagram.png) + If the selected organization has no repositories registered with CodeRabbit, then your browser displays a CodeRabbit permissions dialog for setting up a new integration. Proceed to the next step. -Also, check out the response when asked for what improvements can be done on the code level. + Otherwise, your browser displays a GitHub settings page for your organization's existing CodeRabbit integration. Scroll down to the section titled **Repository access**, and then proceed to the next step. -![Code Improvements Suggested by CodeRabbit](/img/integrations/improvements.png) +1. Select which repositories you'd like to allow CodeRabbit to write code reviews for. -In addition to providing reviews and summaries, **CodeRabbit** can also detect configuration issues. + To give CodeRabbit access to all repositories in the organization, select **All repositories**. This also automatically grants CodeRabbit access to all repositories added to the organization in the future. -> For example, I accidentally set up both CodeRabbit Pro (The process we've been discussing) and the open-source version (Refer to [different config process](https://github.com/coderabbitai/ai-pr-reviewer?tab=readme-ov-file#install-instructions)) in my repository at the same time. + To give CodeRabbit access to specific, limited list of repositories, select **Only select repositories**, and then choose repositories from the list. -CodeRabbit automatically detects and alerts you about configuration conflicts. + :::note + You can change this setting later. + ::: -![Configuration Issues by CodeRabbit](/img/integrations/configuration.png) +1. Click the button at the bottom of the form, which has one of the following labels, depending upon context: -CodeRabbit generates detailed statistics and test plans for each pull request. + - **Install & Authorize**, if this organization has no repositories integrated with CodeRabbit, and you are an owner of this organization. + - **Save**, if this organization already has repositories integrated with CodeRabbit -![Statistics by CodeRabbit](/img/integrations/statistics.png) +1. If you are integrating an organization with CodeRabbit for the first time, then your browser navigates back to the CodeRabbit web interface. -![Test Plan by CodeRabbit](/img/integrations/test-plan.png) + Otherwise, your browser remains on your GitHub settings page, and you can manually navigate [back to the CodeRabbit web interface](https://app.coderabbit.ai/settings/repositories). -> 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) +## What's next -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. +- [Set your repository preferences](/guides/repository-settings) -> Explore, Experiment, Discover how [CodeRabbit](https://docs.coderabbit.ai/) can streamline your code review process using AI. +- [Review pull requests](/guides/code-review-overview) diff --git a/docs/platforms/github-enterprise-server.md b/docs/platforms/github-enterprise-server.md index 2e8a6876..733607cb 100644 --- a/docs/platforms/github-enterprise-server.md +++ b/docs/platforms/github-enterprise-server.md @@ -111,6 +111,7 @@ steps below to - Pull request review thread - Push - Release + - **Where can this GitHub App be installed?**: Select `Any account` 6. Click **Create GitHub App**. Once the GitHub App has been created, click on **Generate a new client secret** @@ -169,4 +170,20 @@ Use this CodeRabbit IP if your instance requires IP whitelisting `35.222.179.152/32` and `34.170.211.100/32`. VPN tunneling is available as an add-on package. Please reach out to us at -[contact@coderabbit.ai](mailto:contact@coderabbit.ai) if you are interested. +[support@coderabbit.ai](mailto:support@coderabbit.ai) if you are interested. + +### **FAQ** + +#### Who should create the OAuth App and GitHub App? + +The OAuth App and GitHub App should be created by a user with administrative +privileges on the GitHub Enterprise Server instance. This user will be responsible for managing the integration with CodeRabbit. + +#### I see an error when trying to log in to CodeRabbit. What should I do? + +If you encounter an error during the login process, please ensure that: + +- The OAuth App and GitHub App are correctly configured with the right URLs and permissions. +- The browser local storage and cookies related to CodeRabbit are cleared. + +If the issue persists, contact our support team. diff --git a/docs/platforms/gitlab-com.mdx b/docs/platforms/gitlab-com.mdx index c276cd35..30b23031 100644 --- a/docs/platforms/gitlab-com.mdx +++ b/docs/platforms/gitlab-com.mdx @@ -107,7 +107,13 @@ By default, GitLab restricts this option to users on the Premium or Ultimate tie 5. Ensure the following scopes are selected: `api`. 6. Ensure Developer Access is provided. ---- +:::tip + +Group Access Tokens create bot users with generic GitLab-generated usernames (like `group_63_bot_5753...`). If you prefer a more descriptive username for your CodeRabbit bot, you can customize it using the [GitLab API](https://docs.gitlab.com/api/users/#modify-a-user). + +You can find the bot's user ID through the CodeRabbit UI if connected, or by visiting the bot user's profile from your Group Members page in GitLab. + +::: ### Where to Provide CodeRabbit the Access Token diff --git a/docs/platforms/platforms.md b/docs/platforms/platforms.md index 996089fc..67689490 100644 --- a/docs/platforms/platforms.md +++ b/docs/platforms/platforms.md @@ -1,35 +1,44 @@ --- -title: Integrate with Git platforms -description: Overview of CodeRabbit's supported Git platforms. +title: Add CodeRabbit to your repository +description: Conceptual overview of integrating CodeRabbit with your Git platform +sidebar_label: Overview --- -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: +This page presents an overview of integrating CodeRabbit with your Git platform. +For a conceptual overview of CodeRabbit, see [Introduction](/). -## GitHub +## Use CodeRabbit with Git platforms -| Host | Support | -| ------------------------ | ---------------------------------------- | -| GitHub.com | [Supported](github-com.md) | -| GitHub Enterprise Server | [Supported](github-enterprise-server.md) | +CodeRabbit integrates with the following Git platforms: -## GitLab +- [GitHub.com](/platforms/github-com) +- [GitHub Enterprise Server](/platforms/github-enterprise-server) +- [GitLab.com](/platforms/gitlab-com) +- [Self-managed GitLab](/platforms/self-hosted-gitlab) +- [Azure DevOps](/platforms/azure-devops) +- [BitBucket Cloud](/platforms/bitbucket-cloud) -| Host | Support | -| ------------------- | ---------------------------------- | -| GitLab.com | [Supported](gitlab-com.mdx) | -| GitLab Self Managed | [Supported](self-hosted-gitlab.md) | +The exact steps for each platform are outlined in the pages linked above. That said, integrating any +Git platform with CodeRabbit follows this general pattern: -## Azure DevOps +1. Log into CodeRabbit using your Git platform account. -| Host | Support | -| ------------ | ---------------------------- | -| Azure DevOps | [Supported](azure-devops.md) | +1. Add the organizations containing the repositories that you want CodeRabbit to work with. You generally need ownership-level permissions with these organizations. (Different Git platforms might call their organizations different + things, such as "groups" in GitLab and "workspaces" in BitBucket.) -## Bitbucket +1. Create a dedicated CodeRabbit service account on your Git platform, if needed. We handle + this step for you on some platforms, such as GitHub.com. -| Host | Support | -| -------------------- | ---------------------------------------- | -| Bitbucket Datacenter | [Supported](../self-hosted/bitbucket.md) | -| Bitbucket Cloud | [Supported](./bitbucket-cloud.md) | +1. Grant CodeRabbit the permissions that it needs to work with one or more + of the repositories that you have ownership-level access to. -[login]: https://app.coderabbit.ai/login +After you finish integrating CodeRabbit with one or more repositories, you can [start using CodeRabbit immediately](/guides/code-review-overview) using its default configuration, which automatically reviews or summarizes new pull requests. You can also [customize CodeRabbit’s configuration](/guides/configuration-overview) to suit your team's needs. + +## What's next {#whats-next} + +- [Integrate CodeRabbit with GitHub.com](/platforms/github-com) +- [Integrate CodeRabbit with GitHub Enterprise Server](/platforms/github-enterprise-server) +- [Integrate CodeRabbit with GitLab.com](/platforms/gitlab-com) +- [Integrate CodeRabbit with Self-managed GitLab](/platforms/self-hosted-gitlab) +- [Integrate CodeRabbit with Azure DevOps](/platforms/azure-devops) +- [Integrate CodeRabbit with BitBucket Cloud](/platforms/bitbucket-cloud) diff --git a/docs/platforms/self-hosted-gitlab.md b/docs/platforms/self-hosted-gitlab.md index 53fae56f..bd330887 100644 --- a/docs/platforms/self-hosted-gitlab.md +++ b/docs/platforms/self-hosted-gitlab.md @@ -71,6 +71,12 @@ 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. +:::note + +If you prefer, you can create a Group Access Token which will create a dedicated user on your behalf. For more information, see [Group Access Token](/docs/platforms/gitlab-com.mdx#group-access-token) + +::: + We recommend using the CodeRabbit [logo](/img/integrations/logo.png) as the profile picture to ensures easy recognition. #### **Creating OAuth2 application** @@ -122,4 +128,4 @@ Use this CodeRabbit IP if your instance requires IP whitelisting `35.222.179.152/32` and `34.170.211.100/32`. VPN tunneling is available as an add-on package. Please reach out to us at -[contact@coderabbit.ai](mailto:contact@coderabbit.ai) if you are interested. +[support@coderabbit.ai](mailto:support@coderabbit.ai) if you are interested. 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/configuration.md b/docs/reference/configuration.md new file mode 100644 index 00000000..d95fbaa0 --- /dev/null +++ b/docs/reference/configuration.md @@ -0,0 +1,4451 @@ +--- +title: Configuration reference +description: Complete reference for all CodeRabbit configuration options. +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +This reference guide lists all of the code review configuration options that +CodeRabbit makes available. + +For an overview of how configuration works with CodeRabbit, see [Configure CodeRabbit](/guides/configuration-overview). + +## How to use this reference {#how-to} + +Each entry in this reference corresponds to a single CodeRabbit configuration setting, including an informational table and a description of what the setting does. The tables have two views, which you can select with a tab: + +- The **Web UI** tab displays the location and default value of the setting in the CodeRabbit web interface, for both [organization settings](/guides/organization-settings) and [repository settings](/guides/repository-settings). +- The **coderabbit.yaml** tab displays information about the field's location and datatype in [your repository's `.coderabbit.yaml` file](/getting-started/configure-coderabbit). + +## Global Settings + +### Data retention + + + + + + + + + + + + + +
LocationGeneral > Data Retention
Defaulttrue
+
+ + _This setting can be defined only in the web UI settings for your + organization._ + +
+ +If `true`, then CodeRabbit is allowed to retain enough data about your code +review history in order to enable the following features: + +- **Caching**: allows CodeRabbit to store data about your repository between + code reviews, improving the speed of subsequent reviews. +- **Knowledge base**: allows CodeRabbit to maintain its own database about + your repository and your team's code review preferences, which can improve + the quality and specificity of code reviews generated by CodeRabbit. + +If your organization operates under strict data-retention policies, then you can +disable data retention. Doing so immediately deletes any cache or knowledge-base data that CodeRabbit has collected for your organization, and prevents CodeRabbit from +retaining further cache or knowledge-base data. + +If you re-enable data retention, then CodeRabbit re-enables these features, and resumes collecting cache and knowledge-base data. + +### Early Access + + + + + + + + + + + + + +
LocationGeneral > Early Access
Defaultfalse
+
+ + + + + + + + + + + + + + + +
Field`early_access`
Datatypeboolean
Defaultfalse
+
+
+ +If enabled, then CodeRabbit lets you use early-access features in your +code reviews. + +### Enable Free Tier + + + + + + + + + + + + + +
LocationGeneral > Enable Free Tier
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`enable_free_tier`
Datatypeboolean
Defaulttrue
+
+
+ +If enabled, then CodeRabbit allows free tier features for users not on a paid plan. + +For more information about payment tiers and features, see [Pricing](https://www.coderabbit.ai/pricing). + +### Language + + + + + + + + + + + + + +
LocationGeneral > Language
Defaulten-US
+
+ + + + + + + + + + + + + + + +
Field`language`
Datatypestring
Default"en-US"
+
+
+ +Defines the written language that CodeRabbit presents its review comments in. Defaults +to U.S. English. + +### Tone Instructions + + + + + + + + + + + + + +
LocationGeneral > Tone Instructions
Default
+
+ + + + + + + + + + + + + + + +
Field`tone_instructions`
Datatypestring
Default
+
+
+ +A natural-language description of the tone of voice that CodeRabbit should +apply to its review instructions, if you want a tone different from its +default. + +A few possible examples: + +- `Use an encouraging, supportive tone that celebrates good practices while gently suggesting improvements.` +- `Adopt a concise, matter-of-fact style that gets straight to the point without unnecessary pleasantries.` +- `Deliver all review comments in the style of a televised nature documentary, perhaps with David Attenborough hosting.` + +## Review + +### Basic Review Settings + +#### Abort On Close + + + + + + + + + + + + + +
LocationReview > Settings > Abort On Close
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.abort_on_close`
Datatypeboolean
Defaulttrue
+
+
+ +Abort the in-progress review if the pull request is closed or merged. + +#### Assess Linked Issues + + + + + + + + + + + + + +
LocationReview > Settings > Assess Linked Issues
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.assess_linked_issues`
Datatypeboolean
Defaulttrue
+
+
+ +If enabled, then the reviews that CodeRabbit generates include assessments of how well a proposed code change addresses any issues that the pull request refers to. CodeRabbit considers issues referred to by number in the following locations: + +- The title of the pull request. +- The description of the pull request. +- (GitHub only) The **Development** field of the pull request. + +Besides this setting, issue assessment requires at least one of the following: + +- You use the built-in issue management system of GitHub or GitLab. +- You have integrated CodeRabbit with an external issue manager. + +For more information, see [Integrate issue tracking](/integrations/issue-integrations/) +and [Let CodeRabbit read your issue tracker](https://docs.coderabbit.ai/guides/setup-best-practices#issues). + +#### Auto Apply Labels + + + + + + + + + + + + + +
LocationReview > Settings > Auto Apply Labels
Defaultfalse
+
+ + + + + + + + + + + + + + + +
Field`reviews.auto_apply_labels`
Datatypeboolean
Defaultfalse
+
+
+ +Automatically apply the suggested labels to the PR/MR. + +#### Auto Assign Reviewers + + + + + + + + + + + + + +
LocationReview > Settings > Auto Assign Reviewers
Defaultfalse
+
+ + + + + + + + + + + + + + + +
Field`reviews.auto_assign_reviewers`
Datatypeboolean
Defaultfalse
+
+
+ +Automatically assign suggested reviewers to the pull request + +#### Auto Title Instructions + + + + + + + + + + + + + +
LocationReview > Settings > Auto Title Instructions
Default
+
+ + + + + + + + + + + + + + + +
Field`reviews.auto_title_instructions`
Datatypestring
Default
+
+
+ +Custom instructions for auto-generating the PR/MR title. + +#### Auto Title Placeholder + + + + + + + + + + + + + +
LocationReview > Settings > Auto Title Placeholder
Default@coderabbitai
+
+ + + + + + + + + + + + + + + +
Field`reviews.auto_title_placeholder`
Datatypestring
Default"@coderabbitai"
+
+
+ +Add this keyword in the PR/MR title to auto-generate the title. + +#### Changed Files Summary + + + + + + + + + + + + + +
LocationReview > Settings > Changed Files Summary
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.changed_files_summary`
Datatypeboolean
Defaulttrue
+
+
+ +Generate a summary of the changed files in the walkthrough. + +#### Collapse Walkthrough + + + + + + + + + + + + + +
LocationReview > Settings > Collapse Walkthrough
Defaultfalse
+
+ + + + + + + + + + + + + + + +
Field`reviews.collapse_walkthrough`
Datatypeboolean
Defaultfalse
+
+
+ +Generate walkthrough in a markdown collapsible section. + +#### Commit Status + + + + + + + + + + + + + +
LocationReview > Settings > Commit Status
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.commit_status`
Datatypeboolean
Defaulttrue
+
+
+ +Set the commit status to 'pending' when the review is in progress and 'success' when it is complete. + +#### Disable Cache + + + + + + + + + + + + + +
LocationReview > Settings > Disable Cache
Defaultfalse
+
+ + + + + + + + + + + + + + + +
Field`reviews.disable_cache`
Datatypeboolean
Defaultfalse
+
+
+ +Activate this setting to disallow CodeRabbit from caching your repository's code and dependencies. This forces CodeRabbit to download the code and dependencies fresh from the repository for every code review that it performs. + +When caching is allowed, then CodeRabbit stores a cache of code and metadata from +your repository for up to seven days after its most recent code review. This cache +lets CodeRabbit save time and effort in between subsequent reviews of the same +repository. For more information, see [Caching](/reference/caching/). + +We recommend leaving this setting off, which allows caching, and can speed up +code reviews. For more information, see +[Trust the defaults](https://docs.coderabbit.ai/guides/setup-best-practices#defaults). + +:::note +The [Data Retention](#data-retention) setting overrides this one. If you disable +all data retention, then your repositories won't keep a cache. +::: + +#### Fail Commit Status + + + + + + + + + + + + + +
LocationReview > Settings > Fail Commit Status
Defaultfalse
+
+ + + + + + + + + + + + + + + +
Field`reviews.fail_commit_status`
Datatypeboolean
Defaultfalse
+
+
+ +Set the commit status to 'failure' when the PR cannot be reviewed by CodeRabbit for any reason. + +#### High Level Summary + + + + + + + + + + + + + +
LocationReview > Settings > High Level Summary
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.high_level_summary`
Datatypeboolean
Defaulttrue
+
+
+ +Generate a high level summary of the changes in the PR/MR description. + +#### High Level Summary In Walkthrough + + + + + + + + + + + + + +
LocationReview > Settings > High Level Summary In Walkthrough
Defaultfalse
+
+ + + + + + + + + + + + + + + +
Field`reviews.high_level_summary_in_walkthrough`
Datatypeboolean
Defaultfalse
+
+
+ +Include the high level summary in the walkthrough comment. + +#### High Level Summary Placeholder + + + + + + + + + + + + + +
LocationReview > Settings > High Level Summary Placeholder
Default@coderabbitai summary
+
+ + + + + + + + + + + + + + + +
Field`reviews.high_level_summary_placeholder`
Datatypestring
Default"@coderabbitai summary"
+
+
+ +Placeholder in the PR/MR description that gets replaced with the high level summary. + +#### Labeling Instructions + + + + + + + + + + + + + +
LocationReview > Settings > Labeling Instructions
Default_Empty array_
+
+ + + + + + + + + + + + + + + +
Field`reviews.labeling_instructions`
Datatypearray
Default[]
+
+
+ +Provide guidelines for suggesting labels for the PR/MR. When specific labels or instructions are provided, only those labels are considered, though previous examples are still used to inform the suggestions. If no such labels are provided, suggestions are based solely on previous PR/MRs. + +#### Path Filters + + + + + + + + + + + + + +
LocationReview > Settings > Path Filters
Default_Empty array_
+
+ + + + + + + + + + + + + + + +
Field`reviews.path_filters`
Datatypearray
Default[]
+
+
+ +Path filters, if defined, restrict the portions of your repository that CodeRabbit +uses for context when preparing code reviews. + +You can define a list of path specifications, relative to the root of your +repository, to use as path filters. + +Paths can be _exclude paths_, which start with a leading `!` character, or _include +paths_. If the list of paths contains at least one include path, then CodeRabbit +includes _only_ files that match the provided paths. + +For example, the following list of path filters instructs CodeRabbit to limit its reviews +only to files found in the `src` top-level directory, but exclude any `.bin` or `.csv` +files: + +```bash +src/** +!**/*.{bin,csv} +``` + +:::note +Under the hood, CodeRabbit uses your provided list of path filters as an argument +to [`git sparse-checkout`](https://git-scm.com/docs/git-sparse-checkout) when preparing its own copy of your repository for code review +context. +::: + +We strongly recommend defining path filters for any repositories that contain +a significant amount of generated files or data that has no contextual bearing on code reviews. +CodeRabbit can work faster if it can ignore files that aren't relevant to pull requests. +For more information, see [Speed up reviews by adding path filters](https://docs.coderabbit.ai/guides/setup-best-practices#filters). + +#### Path Instructions + + + + + + + + + + + + + +
LocationReview > Settings > Path Instructions
Default_Empty array_
+
+ + + + + + + + + + + + + + + +
Field`reviews.path_instructions`
Datatypearray
Default[]
+
+
+ +Path instructions are additional sets of instructions, expressed in natural language, +that you provide to CodeRabbit for reviewing certain files in your repository. + +You associate each set of instructions with a file path relative to the root +of your repository. Your path specification can use extended glob patterns. + +The following example defines a set of path instructions for all TypeScript +and JavaScript files in a repository's `src` directory: + + + + ![An example path instruction](/img/reference/path-instructions.png) + + +```yaml +path_instructions: + - path: src/**/*.{ts,tsx,js} + instructions: | + - Review the React.js/TypeScript/JavaScript code for best practices + - Check for common security vulnerabilities such as: + - SQL Injection + - Insecure dependencies + - Sensitive data exposure +``` + + + +For further examples of path instructions specific to various programming languages, +see [the `awesome-coderabbit` public repository](https://github.com/coderabbitai/awesome-coderabbit/tree/main/configs). + +#### Poem + + + + + + + + + + + + + +
LocationReview > Settings > Poem
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.poem`
Datatypeboolean
Defaulttrue
+
+
+ +Generate a poem in the walkthrough comment. + +#### Profile {#profile} + + + + + + + + + + + + + +
LocationReview > Settings > Profile
Defaultchill
+
+ + + + + + + + + + + + + + + +
Field`reviews.profile`
Datatypestring
Default"chill"
+
+
+ +An overall selector for the level of detail that CodeRabbit should apply to +its reviews. Valid values are the following: + +- **`Chill`**: CodeRabbit provides its usual level of commentary. +- **`Assertive`**: CodeRabbit provides significantly deeper or more verbose commentary, + as much as possible. + +The `Chill` profile is the default setting, and is appropriate for most coding +contexts. The `Assertive` profile mode can get quite nitpicky in some circumstances. We recommend leaving this setting in `Chill`, unless a wordier level of code critique would benefit your team's work. + +#### Related Issues + + + + + + + + + + + + + +
LocationReview > Settings > Related Issues
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.related_issues`
Datatypeboolean
Defaulttrue
+
+
+ +Include possibly related issues in the walkthrough. + +#### Related PRs + + + + + + + + + + + + + +
LocationReview > Settings > Related PRs
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.related_prs`
Datatypeboolean
Defaulttrue
+
+
+ +Include possibly related pull requests in the walkthrough. + +#### Request Changes Workflow + + + + + + + + + + + + + +
LocationReview > Settings > Request Changes Workflow
Defaultfalse
+
+ + + + + + + + + + + + + + + +
Field`reviews.request_changes_workflow`
Datatypeboolean
Defaultfalse
+
+
+ +If enabled, then CodeRabbit marks a pull request as approved once all comments +that CodeRabbit made have been resolved. + +Enable this setting if you want to have CodeRabbit's approval count towards +a minimum number of approvals that your have configured your Git platform +to require before a pull request can be merged. + +#### Review Status + + + + + + + + + + + + + +
LocationReview > Settings > Review Status
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.review_status`
Datatypeboolean
Defaulttrue
+
+
+ +Post review details on each review. Additionally, post a review status when a review is skipped in certain cases. + +#### Sequence Diagrams + + + + + + + + + + + + + +
LocationReview > Settings > Sequence Diagrams
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.sequence_diagrams`
Datatypeboolean
Defaulttrue
+
+
+ +Generate sequence diagrams in the walkthrough. + +#### Suggested Labels + + + + + + + + + + + + + +
LocationReview > Settings > Suggested Labels
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.suggested_labels`
Datatypeboolean
Defaulttrue
+
+
+ +Suggest labels based on the changes in the pull request in the walkthrough. + +#### Suggested Reviewers + + + + + + + + + + + + + +
LocationReview > Settings > Suggested Reviewers
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.suggested_reviewers`
Datatypeboolean
Defaulttrue
+
+
+ +Suggest reviewers based on the changes in the pull request in the walkthrough. + +### Automatic Review + +#### Enable Automatic Review + + + + + + + + + + + + + +
LocationReview > Auto Review > Automatic Review
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.auto_review.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +If enabled, then CodeRabbit reviews new and updated pull requests automatically. For more information, see [Automatically review pull requests](https://docs.coderabbit.ai/guides/code-review-overview#review). + +If disabled, then CodeRabbit performs only reviews that you request manually. For more information on manual review commands, see [Manually request code reviews](/guides/code-review-overview#review). + +Disabling this setting also effectively disables all of the other settings listed in this section. + +#### Automatic Incremental Review + + + + + + + + + + + + + +
LocationReview > Auto Review > Automatic Incremental Review
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.auto_review.auto_incremental_review`
Datatypeboolean
Defaulttrue
+
+
+ +If enabled, then CodeRabbit performs automatic reviews of existing pull requests when their associated branches have commits pushed to them. These incremental reviews happen in addition to the initial code review that CodeRabbit generates after the pull request is first created. + +For more information on manual review commands, see [Manually request code reviews](/guides/code-review-overview#review). + +We recommend leaving this option enabled. + +#### Base Branches {#base-branches} + + + + + + + + + + + + + +
LocationReview > Auto Review > Base Branches
Default_Empty array_
+
+ + + + + + + + + + + + + + + +
Field`reviews.auto_review.base_branches`
Datatypearray
Default[]
+
+
+ +A list of branches that CodeRabbit performs automatic code reviews on, other +than the repository's main branch (usually `main` or `master`.) + +For example, if you add `staging` as a base branch, then CodeRabbit automatically +reviews pull requests on both your repository's default branch and its `staging` branch. + +#### Drafts + + + + + + + + + + + + + +
LocationReview > Auto Review > Drafts
Defaultfalse
+
+ + + + + + + + + + + + + + + +
Field`reviews.auto_review.drafts`
Datatypeboolean
Defaultfalse
+
+
+ +If defined, then CodeRabbit automatically reviews pull requests marked as a draft +in your Git platform. + +#### Ignore Title Keywords + + + + + + + + + + + + + +
LocationReview > Auto Review > Ignore Title Keywords
Default_Empty array_
+
+ + + + + + + + + + + + + + + +
Field`reviews.auto_review.ignore_title_keywords`
Datatypearray
Default[]
+
+
+ +Ignore reviewing if the title of the pull request contains any of these keywords (case-insensitive). + +#### Labels + + + + + + + + + + + + + +
LocationReview > Auto Review > Labels
Default_Empty array_
+
+ + + + + + + + + + + + + + + +
Field`reviews.auto_review.labels`
Datatypearray
Default[]
+
+
+ +If defined with at least one label, then CodeRabbit automatically reviews +only pull requests that have at least one of the labels in this list. + +In this case, you can manually request reviews of pull requests lacking a qualifying label. For more information on manual review commands, see [Manually request code reviews](/guides/code-review-overview#review). + +### Finishing Touches + +#### Docstrings + + + + + + + + + + + + + +
LocationReview > Finishing Touches > Docstrings
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.finishing_touches.docstrings.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +If enabled, then CodeRabbit can generate inline documentation for functions +added in a pull request. For more information, see [Docstrings](/finishing-touches/docstrings). + +#### Unit Tests + + + + + + + + + + + + + +
LocationReview > Finishing Touches > Unit Tests
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.finishing_touches.unit_tests.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +If enabled, then CodeRabbit can generate unit tests for code +added in a pull request. For more information, see [Unit Test Generation](/finishing-touches/unit-test-generation). + +## Chat + +### Auto Reply + + + + + + + + + + + + + +
LocationChat > Auto Reply
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`chat.auto_reply`
Datatypeboolean
Defaulttrue
+
+
+ +Enable the bot to reply automatically without requiring the user to tag it. + +### Integrations + +### Jira + + + + + + + + + + + + + +
LocationChat > Jira
Defaultauto
+
+ + + + + + + + + + + + + + + +
Field`chat.integrations.jira.usage`
Datatypestring
Default"auto"
+
+
+ +Enable the Jira integration for opening issues, etc. 'auto' disables the integration for public repositories. + +### Linear + + + + + + + + + + + + + +
LocationChat > Linear
Defaultauto
+
+ + + + + + + + + + + + + + + +
Field`chat.integrations.linear.usage`
Datatypestring
Default"auto"
+
+
+ +Enable the Linear integration for opening issues, etc. 'auto' disables the integration for public repositories. + +## Knowledge Base + +### Basic settings + +#### Opt Out + + + + + + + + + + + + + +
LocationKnowledge Base > Opt Out
Defaultfalse
+
+ + + + + + + + + + + + + + + +
Field`knowledge_base.opt_out`
Datatypeboolean
Defaultfalse
+
+
+ +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. + +#### Pull Requests + + + + + + + + + + + + + +
LocationKnowledge Base > Pull Requests
Defaultauto
+
+ + + + + + + + + + + + + + + +
Field`knowledge_base.pull_requests.scope`
Datatypestring
Default"auto"
+
+
+ +Specify the scope of pull requests to use for the knowledge base. 'local' uses the repository's pull requests, 'global' uses the organization's pull requests, and 'auto' uses repository's pull requests for public repositories and organization's pull requests for private repositories. + +#### Web Search + + + + + + + + + + + + + +
LocationKnowledge Base > Web Search
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`knowledge_base.web_search.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Enable the web search integration. + +### Issues + + + + + + + + + + + + + +
LocationKnowledge Base > Issues
Defaultauto
+
+ + + + + + + + + + + + + + + +
Field`knowledge_base.issues.scope`
Datatypestring
Default"auto"
+
+
+ +Specify the scope of git platform (GitHub/GitLab) issues to use for the knowledge base. 'local' uses the repository's issues, 'global' uses the organization's issues, and 'auto' uses repository's issues for public repositories and organization's issues for private repositories. + +### Jira + +#### Enable Jira + + + + + + + + + + + + + +
LocationKnowledge Base > Jira
Defaultauto
+
+ + + + + + + + + + + + + + + +
Field`knowledge_base.jira.usage`
Datatypestring
Default"auto"
+
+
+ +Enable the Jira knowledge base integration. 'auto' disables the integration for public repositories. + +#### Project Keys + + + + + + + + + + + + + +
LocationKnowledge Base > Project Keys
Default_Empty array_
+
+ + + + + + + + + + + + + + + +
Field`knowledge_base.jira.project_keys`
Datatypearray
Default[]
+
+
+ +Specify the Jira project keys to use for the knowledge base. + +### Learnings + + + + + + + + + + + + + +
LocationKnowledge Base > Learnings
Defaultauto
+
+ + + + + + + + + + + + + + + +
Field`knowledge_base.learnings.scope`
Datatypestring
Default"auto"
+
+
+ +Specify the scope of learnings to use for the knowledge base. 'local' uses the repository's learnings, 'global' uses the organization's learnings, and 'auto' uses repository's learnings for public repositories and organization's learnings for private repositories. + +### Code guidelines + +You can define a list of paths that guide CodeRabbit to your organization's code guidelines. +If you do, then CodeRabbit applies these guidelines to its code reviews. For more +information, see [Code Guidelines](/integrations/knowledge-base#code_guidelines). + +#### Enable code guidelines + + + + + + + + + + + + + +
LocationKnowledge Base > Enabled
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`knowledge_base.code_guidelines.enabled`
Datatypeboolean
Default`true`
+
+
+ +Enable CodeRabbit to enforce your organization's coding standards during reviews. + +#### File patterns + + + + + + + + + + + + + +
LocationKnowledge Base > File Patterns
Default_No patterns_
+
+ + + + + + + + + + + + + + + +
Field`knowledge_base.code_guidelines.filePatterns`
Datatypearray
Default`[]`
+
+
+ +A list of path specifications to your repository's coding guideline documents, relative +to the root of your repository. Fileglob matching is allowed. Paths are case-sensitive. + +If the code guidelines feature is enabled, then CodeRabbit applies code-guideline +documents found at the following paths, in addition to any paths that you define: + +- `**/.cursorrules` +- `.github/copilot-instructions.md` +- `**/CLAUDE.md` +- `**/GEMINI.md` +- `**/.cursor/rules/*` +- `**/.windsurfrules` +- `**/.clinerules/*` +- `**/.rules/*` +- `**/AGENT.md` + +### Linear + +#### Enable Linear + + + + + + + + + + + + + +
LocationKnowledge Base > Linear
Defaultauto
+
+ + + + + + + + + + + + + + + +
Field`knowledge_base.linear.usage`
Datatypestring
Default"auto"
+
+
+ +Enable the Linear knowledge base integration. 'auto' disables the integration for public repositories. + +#### Team Keys + + + + + + + + + + + + + +
LocationKnowledge Base > Team Keys
Default_Empty array_
+
+ + + + + + + + + + + + + + + +
Field`knowledge_base.linear.team_keys`
Datatypearray
Default[]
+
+
+ +Specify the Linear team keys (identifiers) to use for the knowledge base. E.g. 'ENG' + +## Code Generation + +### Code Generation Language + + + + + + + + + + + + + +
LocationCode Generation > Language
Defaulten-US
+
+ + + + + + + + + + + + + + + +
Field`code_generation.docstrings.language`
Datatypestring
Default"en-US"
+
+
+ +Set the language for docstrings by using the corresponding ISO language code. + +### Docstring Path Instructions + + + + + + + + + + + + + +
LocationCode Generation > Path Instructions
Default_Empty array_
+
+ + + + + + + + + + + + + + + +
Field`code_generation.docstrings.path_instructions`
Datatypearray
Default[]
+
+
+ +Provide additional guidelines for docstring generation based on file paths. + +### Unit Test Path Instructions + + + + + + + + + + + + + +
LocationCode Generation > Unit Test Generation
Default_Empty array_
+
+ + + + + + + + + + + + + + + +
Field`code_generation.unit_tests.path_instructions`
Datatypearray
Default[]
+
+
+ +Provide additional guidelines for unit test generation based on file paths. + +## Tools + +CodeRabbit integrates with various third-party tools for enhanced code analysis. + +### actionlint + +actionlint is a static checker for GitHub Actions workflow files. + +#### Enable actionlint + + + + + + + + + + + + + +
LocationReview > Tools > Enable actionlint
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.actionlint.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +is a static checker for GitHub Actions workflow files. + +### ast-grep + +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 + +#### Essential Rules + + + + + + + + + + + + + +
LocationReview > Tools > ast-grep > Essential Rules
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.ast-grep.essential_rules`
Datatypeboolean
Defaulttrue
+
+
+ +Use ast-grep essentials package. + +#### Packages + + + + + + + + + + + + + +
LocationReview > Tools > ast-grep > Packages
Default_Empty array_
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.ast-grep.packages`
Datatypearray
Default[]
+
+
+ +Predefined packages to be used. + +#### Rule Dirs + + + + + + + + + + + + + +
LocationReview > Tools > ast-grep > Rule Dirs
Default_Empty array_
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.ast-grep.rule_dirs`
Datatypearray
Default[]
+
+
+ +List of rules directories. + +#### Util Dirs + + + + + + + + + + + + + +
LocationReview > Tools > ast-grep > Util Dirs
Default_Empty array_
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.ast-grep.util_dirs`
Datatypearray
Default[]
+
+
+ +List of utils directories. + +### Biome + +Biome is a fast formatter, linter, and analyzer for web projects. + +#### Enable Biome + + + + + + + + + + + + + +
LocationReview > Tools > Enable Biome
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.biome.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Biome is a fast formatter, linter, and analyzer for web projects. + +### Brakeman + +Brakeman is a static analysis security vulnerability scanner for Ruby on Rails applications. | v7.0.2 + +#### Enable Brakeman + + + + + + + + + + + + + +
LocationReview > Tools > Enable Brakeman
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.brakeman.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Brakeman is a static analysis security vulnerability scanner for Ruby on Rails applications. + +### Buf + +Buf offers linting for Protobuf files. + +#### Enable Buf + + + + + + + + + + + + + +
LocationReview > Tools > Enable Buf
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.buf.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Buf offers linting for Protobuf files. + +### checkmake + +checkmake is a linter for Makefiles. + +#### Enable checkmake + + + + + + + + + + + + + +
LocationReview > Tools > Enable checkmake
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.checkmake.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +checkmake is a linter for Makefiles. + +### Checkov + +Checkov is a static code analysis tool for infrastructure-as-code files. + +#### Enable Checkov + + + + + + + + + + + + + +
LocationReview > Tools > Enable Checkov
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.checkov.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Checkov is a static code analysis tool for infrastructure-as-code files. + +### CircleCI + +CircleCI tool is a static checker for CircleCI config files. + +#### Enable CircleCI + + + + + + + + + + + + + +
LocationReview > Tools > Enable CircleCI
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.circleci.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +CircleCI tool is a static checker for CircleCI config files. + +### Clippy + +Clippy is a collection of lints to catch common mistakes and improve your Rust code. + +#### Enable Clippy + + + + + + + + + + + + + +
LocationReview > Tools > Enable Clippy
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.clippy.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Clippy is a collection of lints to catch common mistakes and improve your Rust code. + +### Cppcheck + +Cppcheck is a static code analysis tool for the C and C++ programming languages. + +#### Enable Cppcheck + + + + + + + + + + + + + +
LocationReview > Tools > Enable Cppcheck
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.cppcheck.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Cppcheck is a static code analysis tool for the C and C++ programming languages. + +### detekt + +Detekt is a static code analysis tool for Kotlin files. + +#### Enable detekt + + + + + + + + + + + + + +
LocationReview > Tools > detekt > Enable
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.detekt.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Enable detekt. + +#### Config File + + + + + + + + + + + + + +
LocationReview > Tools > detekt > Config File
Default_No default_
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.detekt.config_file`
Datatypestring
Default_No default_
+
+
+ +Optional path to the detekt configuration file relative to the repository. + +### dotenv-linter + +dotenv-linter is a tool for checking and fixing .env files for problems and best practices + +#### Enable dotenv-linter + + + + + + + + + + + + + +
LocationReview > Tools > Enable dotenv-linter
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.dotenvLint.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +dotenv-linter is a tool for checking and fixing .env files for problems and best practices + +### ESLint + +ESLint is a static code analysis tool for JavaScript files. + +#### Enable ESLint + + + + + + + + + + + + + +
LocationReview > Tools > Enable ESLint
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.eslint.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +ESLint is a static code analysis tool for JavaScript files. + +### Flake8 + +Flake8 is a static code analysis tool for Python files. + +#### Enable Flake8 + + + + + + + + + + + + + +
LocationReview > Tools > Flake8 > Enable
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.flake8.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Flake8 is a static code analysis tool for Python files. + +### GitHub Checks + +GitHub Checks integration configuration. + +#### Enable GitHub Checks + + + + + + + + + + + + + +
LocationReview > Tools > GitHub Checks > Enable
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.github-checks.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Enable integration, defaults to true + +#### Timeout Ms + + + + + + + + + + + + + +
LocationReview > Tools > GitHub Checks > Timeout Ms
Default90000
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.github-checks.timeout_ms`
Datatypenumber
Default90000
+
+
+ +Time in milliseconds to wait for all GitHub Checks to conclude. + +### Gitleaks + +Gitleaks is a secret scanner. + +#### Enable Gitleaks + + + + + + + + + + + + + +
LocationReview > Tools > Enable Gitleaks
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.gitleaks.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Gitleaks is a secret scanner. + +### golangci-lint + +golangci-lint is a fast linters runner for Go. + +#### Enable golangci-lint + + + + + + + + + + + + + +
LocationReview > Tools > golangci-lint > Enable
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.golangci-lint.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Enable golangci-lint. + +#### Config File + + + + + + + + + + + + + +
LocationReview > Tools > golangci-lint > Config File
Default_No default_
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.golangci-lint.config_file`
Datatypestring
Default_No default_
+
+
+ +Optional path to the golangci-lint configuration file relative to the repository. Useful when the configuration file is named differently than the default '.golangci.yml', '.golangci.yaml', '.golangci.toml', '.golangci.json'. + +### Hadolint + +Hadolint is a Dockerfile linter. + +#### Enable Hadolint + + + + + + + + + + + + + +
LocationReview > Tools > Enable Hadolint
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.hadolint.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Hadolint is a Dockerfile linter. + +### HTMLHint + +HTMLHint is a static code analysis tool for HTML files. + +#### Enable HTMLHint + + + + + + + + + + + + + +
LocationReview > Tools > HTMLHint > Enable
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.htmlhint.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Enable HTMLHint. + +#### Config File + + + + + + + + + + + + + +
LocationReview > Tools > HTMLHint > Config File
Default_No default_
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.htmlhint.config_file`
Datatypestring
Default_No default_
+
+
+ +Optional path to the HTMLHint configuration file relative to the repository. This is useful when the configuration file is named differently than the default '.htmlhintrc'. + +### LanguageTool + +LanguageTool is a style and grammar checker for 30+ languages. + +#### Disabled Categories + + + + + + + + + + + + + +
LocationReview > Tools > LanguageTool > Disabled Categories
Default_Empty array_
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.languagetool.disabled_categories`
Datatypearray
Default[]
+
+
+ +IDs of categories to be disabled. Note: TYPOS, TYPOGRAPHY, and CASING are always disabled. + +#### Disabled Rules + + + + + + + + + + + + + +
LocationReview > Tools > LanguageTool > Disabled Rules
Default_Empty array_
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.languagetool.disabled_rules`
Datatypearray
Default[]
+
+
+ +IDs of rules to be disabled. Note: EN_UNPAIRED_BRACKETS, and EN_UNPAIRED_QUOTES are always disabled. + +#### Enable LanguageTool + + + + + + + + + + + + + +
LocationReview > Tools > LanguageTool > Enable
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.languagetool.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Enable LanguageTool + +#### Enabled Categories + + + + + + + + + + + + + +
LocationReview > Tools > LanguageTool > Enabled Categories
Default_Empty array_
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.languagetool.enabled_categories`
Datatypearray
Default[]
+
+
+ +IDs of categories to be enabled. + +#### Enabled Only + + + + + + + + + + + + + +
LocationReview > Tools > LanguageTool > Enabled Only
Defaultfalse
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.languagetool.enabled_only`
Datatypeboolean
Defaultfalse
+
+
+ +Only the rules and categories whose IDs are specified with 'enabledRules' or 'enabledCategories' are enabled. + +#### Enabled Rules + + + + + + + + + + + + + +
LocationReview > Tools > LanguageTool > Enabled Rules
Default_Empty array_
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.languagetool.enabled_rules`
Datatypearray
Default[]
+
+
+ +IDs of rules to be enabled. The rule won't run unless 'level' is set to a level that activates the rule. + +#### Level + + + + + + + + + + + + + +
LocationReview > Tools > LanguageTool > Level
Defaultdefault
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.languagetool.level`
Datatypestring
Default"default"
+
+
+ +If set to 'picky', additional rules will be activated, i.e. rules that you might only find useful when checking formal text. + +### Luacheck + +Configuration for Lua code linting to ensure code quality + +#### Enable Luacheck + + + + + + + + + + + + + +
LocationReview > Tools > Enable Luacheck
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.luacheck.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Luacheck helps maintain consistent and error-free Lua code + +### markdownlint + +markdownlint-cli2 is a static analysis tool to enforce standards and consistency for Markdown files. + +#### Enable markdownlint + + + + + + + + + + + + + +
LocationReview > Tools > Enable markdownlint
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.markdownlint.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +markdownlint-cli2 is a static analysis tool to enforce standards and consistency for Markdown files. + +### Oxlint + +Oxlint is a JavaScript/TypeScript linter for OXC written in Rust. + +#### Enable Oxlint + + + + + + + + + + + + + +
LocationReview > Tools > Enable Oxlint
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.oxc.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Oxlint is a JavaScript/TypeScript linter for OXC written in Rust. + +### PHPStan + +PHPStan is a tool to analyze PHP code. + +#### Enable PHPStan + + + + + + + + + + + + + +
LocationReview > Tools > PHPStan > Enable
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.phpstan.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +PHPStan requires [config file](https://phpstan.org/config-reference#config-file) in your repository root. Please ensure that this file contains the `paths:` parameter. + +#### Level + + + + + + + + + + + + + +
LocationReview > Tools > PHPStan > Level
Defaultdefault
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.phpstan.level`
Datatypestring
Default"default"
+
+
+ +Specify the [rule level](https://phpstan.org/user-guide/rule-levels) to run. This setting is ignored if your configuration file already has a `level:` parameter. + +### PMD + +PMD is an extensible multilanguage static code analyzer. It’s mainly concerned with Java. + +#### Enable PMD + + + + + + + + + + + + + +
LocationReview > Tools > PMD > Enable
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.pmd.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Enable PMD. + +#### Config File + + + + + + + + + + + + + +
LocationReview > Tools > PMD > Config File
Default_No default_
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.pmd.config_file`
Datatypestring
Default_No default_
+
+
+ +Optional path to the PMD configuration file relative to the repository. + +### PHPMD + +PHPMD is a static code analysis tool for PHP files. + +#### Enable PHPMD + + + + + + + + + + + + + +
LocationReview > Tools > Enable PHPMD
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.phpmd.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +PHPMD is a static code analysis tool for PHP files. + +### PHPCS + +PHPCS is a static code analysis and coding-standard checker for PHP (plus JS/CSS) files. + +#### Enable PHPCS + + + + + + + + + + + + + +
LocationReview > Tools > Enable PHPCS
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.phpcs.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +PHPCS is a static code analysis tool for PHP, JavaScript and CSS files. + +### Prisma Schema Linting + +Configuration for Prisma Schema linting to ensure schema file quality + +#### Enable Prisma Schema Linting + + + + + + + + + + + + + +
LocationReview > Tools > Enable Prisma Schema Linting
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.prismaLint.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Prisma Schema linting helps maintain consistent and error-free schema files + +### Pylint + +Pylint is a Python static code analysis tool. + +#### Enable Pylint + + + + + + + + + + + + + +
LocationReview > Tools > Enable Pylint
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.pylint.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Pylint is a Python static code analysis tool. + +### Regal + +Regal is a linter and language server for Rego. + +#### Enable Regal + + + + + + + + + + + + + +
LocationReview > Tools > Enable Regal
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.regal.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Regal is a linter and language server for Rego. + +### RuboCop + +RuboCop is a Ruby static code analyzer (a.k.a. linter ) and code formatter. + +#### Enable RuboCop + + + + + + + + + + + + + +
LocationReview > Tools > Enable RuboCop
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.rubocop.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +RuboCop is a Ruby static code analyzer (a.k.a. linter ) and code formatter. + +### Ruff + +Ruff is a Python linter and code formatter. + +#### Enable Ruff + + + + + + + + + + + + + +
LocationReview > Tools > Enable Ruff
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.ruff.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Ruff is a Python linter and code formatter. + +### Semgrep + +Semgrep is a static analysis tool designed to scan code for security vulnerabilities and code quality issues. + +#### Enable Semgrep + + + + + + + + + + + + + +
LocationReview > Tools > Semgrep > Enable
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.semgrep.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Enable Semgrep. + +#### Config File + + + + + + + + + + + + + +
LocationReview > Tools > Semgrep > Config File
Default_No default_
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.semgrep.config_file`
Datatypestring
Default_No default_
+
+
+ +Optional path to the Semgrep configuration file relative to the repository. + +### ShellCheck + +ShellCheck is a static analysis tool that finds bugs in your shell scripts. + +#### Enable ShellCheck + + + + + + + + + + + + + +
LocationReview > Tools > Enable ShellCheck
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.shellcheck.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +ShellCheck is a static analysis tool that finds bugs in your shell. + +### Shopify Theme Check + +Configuration for Shopify Theme Check to ensure theme quality and best practices + +#### Enable Shopify Theme Check + + + + + + + + + + + + + +
LocationReview > Tools > Enable Shopify Theme Check
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.shopifyThemeCheck.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +A linter for Shopify themes that helps you follow Shopify theme & Liquid best practices + +### SQLFluff + +SQLFluff is an open source, dialect-flexible and configurable SQL linter. + +#### Enable SQLFluff + + + + + + + + + + + + + +
LocationReview > Tools > Enable SQLFluff
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.sqlfluff.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +SQLFluff is an open source, dialect-flexible and configurable SQL linter. + +### SwiftLint + +SwiftLint integration configuration object. + +#### Enable SwiftLint + + + + + + + + + + + + + +
LocationReview > Tools > SwiftLint > Enable
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.swiftlint.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +Enable SwiftLint. + +#### Config File + + + + + + + + + + + + + +
LocationReview > Tools > SwiftLint > Config File
Default_No default_
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.swiftlint.config_file`
Datatypestring
Default_No default_
+
+
+ +Optional path to the SwiftLint configuration file relative to the repository. This is useful when the configuration file is named differently than the default '.swiftlint.yml' or '.swiftlint.yaml'. + +### YAMLlint + +YAMLlint is a linter for YAML files. + +#### Enable YAMLlint + + + + + + + + + + + + + +
LocationReview > Tools > Enable YAMLlint
Defaulttrue
+
+ + + + + + + + + + + + + + + +
Field`reviews.tools.yamllint.enabled`
Datatypeboolean
Defaulttrue
+
+
+ +YAMLlint is a linter for YAML files. diff --git a/docs/reference/review-commands.md b/docs/reference/review-commands.md new file mode 100644 index 00000000..dc3c97b8 --- /dev/null +++ b/docs/reference/review-commands.md @@ -0,0 +1,48 @@ +--- +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 generate unit tests` | Generates unit tests for the PR | When you need automatic unit testing 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/reference/yaml-template.md b/docs/reference/yaml-template.md new file mode 100644 index 00000000..99fafa34 --- /dev/null +++ b/docs/reference/yaml-template.md @@ -0,0 +1,193 @@ +--- +title: Configuration file template +--- + +You can use the following template as a basis for a new `.coderabbit.yaml` configuration file at the root level of your repository. + +If used as-is as a `.coderabbit.yaml` file, then this template sets the default, recommended values for [all CodeRabbit repository options](/reference/configuration). You can then update the values to best suit your team's code-review needs. + +For more information about using a `.coderabbit.yaml` file, see [Add a configuration file](/getting-started/configure-coderabbit). + +For a general overview of CodeRabbit configuration, see [Configure CodeRabbit](/guides/configuration-overview). + +```yaml +# yaml-language-server: $schema=https://storage.googleapis.com/coderabbit_public_assets/schema.v2.json + +language: en-US +tone_instructions: "" +early_access: true +enable_free_tier: true +reviews: + profile: chill + request_changes_workflow: false + high_level_summary: true + high_level_summary_placeholder: "@coderabbitai summary" + high_level_summary_in_walkthrough: false + auto_title_placeholder: "@coderabbitai" + auto_title_instructions: "" + review_status: true + commit_status: true + fail_commit_status: false + collapse_walkthrough: false + changed_files_summary: true + sequence_diagrams: true + estimate_code_review_effort: true + assess_linked_issues: true + related_issues: true + related_prs: true + suggested_labels: true + auto_apply_labels: false + suggested_reviewers: true + auto_assign_reviewers: false + poem: true + labeling_instructions: + - label: "" + instructions: "" + path_filters: [] + path_instructions: + - path: "" + instructions: "" + abort_on_close: true + disable_cache: false + auto_review: + enabled: true + auto_incremental_review: true + ignore_title_keywords: [] + labels: [] + drafts: false + base_branches: [] + finishing_touches: + docstrings: + enabled: true + unit_tests: + enabled: true + tools: + ast-grep: + rule_dirs: [] + util_dirs: [] + essential_rules: true + packages: [] + shellcheck: + enabled: true + ruff: + enabled: true + markdownlint: + enabled: true + github-checks: + enabled: true + timeout_ms: 90000 + languagetool: + enabled: true + enabled_rules: [] + disabled_rules: [] + enabled_categories: [] + disabled_categories: [] + enabled_only: false + level: default + biome: + enabled: true + hadolint: + enabled: true + swiftlint: + enabled: true + config_file: "" + phpstan: + enabled: true + level: default + golangci-lint: + enabled: true + config_file: "" + yamllint: + enabled: true + gitleaks: + enabled: true + checkov: + enabled: true + detekt: + enabled: true + config_file: "" + eslint: + enabled: true + flake8: + enabled: true + rubocop: + enabled: true + buf: + enabled: true + regal: + enabled: true + actionlint: + enabled: true + pmd: + enabled: true + config_file: "" + phpmd: + enabled: true + phpcs: + enabled: true + cppcheck: + enabled: true + semgrep: + enabled: true + config_file: "" + circleci: + enabled: true + clippy: + enabled: true + sqlfluff: + enabled: true + prismaLint: + enabled: true + pylint: + enabled: true + oxc: + enabled: true + shopifyThemeCheck: + enabled: true + luacheck: + enabled: true + brakeman: + enabled: true + dotenvLint: + enabled: true + htmlhint: + enabled: true + checkmake: + enabled: true +chat: + auto_reply: true + integrations: + jira: + usage: auto + linear: + usage: auto +knowledge_base: + opt_out: false + web_search: + enabled: true + code_guidelines: + enabled: true + filePatterns: [] + learnings: + scope: auto + issues: + scope: auto + jira: + usage: auto + project_keys: [] + linear: + usage: auto + team_keys: [] + pull_requests: + scope: auto +code_generation: + docstrings: + language: en-US + path_instructions: + - path: "" + instructions: "" + unit_tests: + path_instructions: + - path: "" + instructions: "" +``` diff --git a/docs/self-hosted/azure-devops.md b/docs/self-hosted/azure-devops.md index 97137b11..c7b7f21b 100644 --- a/docs/self-hosted/azure-devops.md +++ b/docs/self-hosted/azure-devops.md @@ -64,7 +64,8 @@ LLM_PROVIDER=azure-openai LLM_TIMEOUT=360000 AZURE_OPENAI_ENDPOINT= AZURE_OPENAI_API_KEY= -## it is recommended to deploy gpt-4.1-mini, o4-mini, o3 deployments, gpt-4.1 (optionally). +# it is recommended to deploy text-embedding-3-large, gpt-4.1-mini, o4-mini, o3, gpt-4.1 (optionally). +AZURE_TEXT_EMBEDDING_3_LARGE_DEPLOYMENT_NAME= AZURE_GPT41MINI_DEPLOYMENT_NAME= AZURE_O4MINI_DEPLOYMENT_NAME= AZURE_O3_DEPLOYMENT_NAME= @@ -96,11 +97,15 @@ HTTPS_PROXY=[] NO_PROXY=[] # if using AWS Bedrock +# it is required to have access to claude-3-haiku, claude-3-5-haiku, claude-sonnet-4, claude-opus-4. LLM_PROVIDER=bedrock-anthropic LLM_TIMEOUT=360000 AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_REGION= +# optionally, use cross-region inference to access models in other regions +# if this is set to `true`, CodeRabbit will access models from `us`, `eu`, or `ap` regions based on the AWS_REGION value. +AWS_USE_CROSS_REGION_INFERENCE=[] TEMP_PATH=/cache @@ -113,10 +118,19 @@ CODERABBIT_LICENSE_KEY= CODERABBIT_API_KEY= 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=[] + +# CodeRabbit - KNOWLEDGE BASE +# +# Requisite: To enable CodeRabbit's knowledge base, you need to provide an object store URI. +OBJECT_STORE_URI=[] # All major object stores are supported e.g., s3://bucket/path/to/database, gs://bucket/path/to/database, etc. + +ENABLE_KNOWLEDGE_BASE=[true] # Global feature flag to enable/disable all knowledge base features. + +ENABLE_PRS_INDEX=[true] # Feature flag to enable/disable PRs indexing. +ENABLE_ISSUES_INDEX=[true] # Feature flag to enable/disable Issues indexing. +ENABLE_LEARNING_INDEX=[true] # Feature flag to enable/disable Learning indexing. +ENABLE_CODE_GUIDELINES_INDEX=[true] # Feature flag to enable/disable Code Guidelines indexing. +ENABLE_CODE_INDEX=[true] # Feature flag to enable/disable Code indexing. JIRA_HOST=[] JIRA_PAT=[] @@ -125,6 +139,8 @@ LINEAR_PAT=[] ENABLE_WEB_SEARCH=[true] PERPLEXITY_API_KEY=[] + +YAML_CONFIG=[] ``` :::note @@ -132,6 +148,7 @@ PERPLEXITY_API_KEY=[] - If you are using Azure OpenAI, verify that the model deployment names are in the .env file. - Values marked with [] are not optional to provide. - You can generate `CODERABBIT_API_KEY` from CodeRabbit UI -> Organizations Settings -> API Keys. +- `YAML_CONFIG` is an optional configuration file that can be used to customize CodeRabbit's behavior at the deployment level. It takes the same format as the [CodeRabbit YAML configuration](/docs/getting-started/configure-coderabbit.md) file. It requires the entire YAML file to be in an escaped string format, for example, `YAML_CONFIG="key1: value1\nkey2: value2"`. You can use [Escape YAML](https://escapeyaml.dev/) to generate the escaped string. ::: diff --git a/docs/self-hosted/bitbucket.md b/docs/self-hosted/bitbucket.md index 0adbeed6..9d20ec39 100644 --- a/docs/self-hosted/bitbucket.md +++ b/docs/self-hosted/bitbucket.md @@ -56,7 +56,8 @@ LLM_PROVIDER=azure-openai LLM_TIMEOUT=360000 AZURE_OPENAI_ENDPOINT= AZURE_OPENAI_API_KEY= -## it is recommended to deploy gpt-4.1-mini, o4-mini, o3 deployments, gpt-4.1 (optionally). +# it is recommended to deploy text-embedding-3-large, gpt-4.1-mini, o4-mini, o3, gpt-4.1 (optionally). +AZURE_TEXT_EMBEDDING_3_LARGE_DEPLOYMENT_NAME= AZURE_GPT41MINI_DEPLOYMENT_NAME= AZURE_O4MINI_DEPLOYMENT_NAME= AZURE_O3_DEPLOYMENT_NAME= @@ -88,11 +89,15 @@ HTTPS_PROXY=[] NO_PROXY=[] # if using AWS Bedrock +# it is required to have access to claude-3-haiku, claude-3-5-haiku, claude-sonnet-4, claude-opus-4. LLM_PROVIDER=bedrock-anthropic LLM_TIMEOUT=360000 AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_REGION= +# optionally, use cross-region inference to access models in other regions +# if this is set to `true`, CodeRabbit will access models from `us`, `eu`, or `ap` regions based on the AWS_REGION value. +AWS_USE_CROSS_REGION_INFERENCE=[] # System Configuration TEMP_PATH=/cache @@ -108,10 +113,20 @@ CODERABBIT_LICENSE_KEY= CODERABBIT_API_KEY= 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=[] + + +# CodeRabbit - KNOWLEDGE BASE +# +# Requisite: To enable CodeRabbit's knowledge base, you need to provide an object store URI. +OBJECT_STORE_URI=[] # All major object stores are supported e.g., s3://bucket/path/to/database, gs://bucket/path/to/database, etc. + +ENABLE_KNOWLEDGE_BASE=[true] # Global feature flag to enable/disable all knowledge base features. + +ENABLE_PRS_INDEX=[true] # Feature flag to enable/disable PRs indexing. +ENABLE_ISSUES_INDEX=[true] # Feature flag to enable/disable Issues indexing. +ENABLE_LEARNING_INDEX=[true] # Feature flag to enable/disable Learning indexing. +ENABLE_CODE_GUIDELINES_INDEX=[true] # Feature flag to enable/disable Code Guidelines indexing. +ENABLE_CODE_INDEX=[true] # Feature flag to enable/disable Code indexing. JIRA_HOST=[] JIRA_PAT=[] @@ -120,6 +135,8 @@ LINEAR_PAT=[] ENABLE_WEB_SEARCH=[true] PERPLEXITY_API_KEY=[] + +YAML_CONFIG=[] ``` :::note @@ -127,6 +144,7 @@ PERPLEXITY_API_KEY=[] - If you are using Azure OpenAI, verify that the model deployment names are in the .env file. Values marked with [] are optional and can be omitted if the feature is not needed. - You can generate `CODERABBIT_API_KEY` from CodeRabbit UI -> Organizations Settings -> API Keys. +- `YAML_CONFIG` is an optional configuration file that can be used to customize CodeRabbit's behavior at the deployment level. It takes the same format as the [CodeRabbit YAML configuration](/docs/getting-started/configure-coderabbit.md) file. It requires the entire YAML file to be in an escaped string format, for example, `YAML_CONFIG="key1: value1\nkey2: value2"`. You can use [Escape YAML](https://escapeyaml.dev/) to generate the escaped string. ::: @@ -139,18 +157,18 @@ cat coderabbit.json | docker login -u _json_key --password-stdin us-docker.pkg.d docker pull us-docker.pkg.dev/coderabbitprod/self-hosted/coderabbit-agent:latest ``` -### Verify the image is up +## Host the image -You can query `/health` endpoint to verify that the `coderabbit-agent` service is up and running. +You can host the image on a server, serverless function, or container environment and expose port `8080`. Run the Docker image with the equivalent command on your chosen platform, ensuring you replace the `.env` file path with the path to your actual `.env` file: ```bash -curl 127.0.0.1:8080/health +docker run --env-file .env --publish 127.0.0.1:8080:8080 us-docker.pkg.dev/coderabbitprod/self-hosted/coderabbit-agent:latest ``` -## Host the image +### Verify the image is up -You can host the image on a server, serverless function, or container environment and expose port `8080`. Run the Docker image with the equivalent command on your chosen platform, ensuring you replace the `.env` file path with the path to your actual `.env` file: +You can query `/health` endpoint to verify that the `coderabbit-agent` service is up and running. ```bash -docker run --env-file .env --publish 127.0.0.1:8080:8080 us-docker.pkg.dev/coderabbitprod/self-hosted/coderabbit-agent:latest +curl 127.0.0.1:8080/health ``` diff --git a/docs/self-hosted/github.md b/docs/self-hosted/github.md index 8f7e4962..accdb8a2 100644 --- a/docs/self-hosted/github.md +++ b/docs/self-hosted/github.md @@ -67,7 +67,8 @@ LLM_PROVIDER=azure-openai LLM_TIMEOUT=360000 AZURE_OPENAI_ENDPOINT= AZURE_OPENAI_API_KEY= -## it is recommended to deploy gpt-4.1-mini, o4-mini, o3 deployments, gpt-4.1 (optionally). +# it is recommended to deploy text-embedding-3-large, gpt-4.1-mini, o4-mini, o3, gpt-4.1 (optionally). +AZURE_TEXT_EMBEDDING_3_LARGE_DEPLOYMENT_NAME= AZURE_GPT41MINI_DEPLOYMENT_NAME= AZURE_O4MINI_DEPLOYMENT_NAME= AZURE_O3_DEPLOYMENT_NAME= @@ -99,11 +100,15 @@ HTTPS_PROXY=[] NO_PROXY=[] # if using AWS Bedrock +# it is required to have access to claude-3-haiku, claude-3-5-haiku, claude-sonnet-4, claude-opus-4. LLM_PROVIDER=bedrock-anthropic LLM_TIMEOUT=360000 AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_REGION= +# optionally, use cross-region inference to access models in other regions +# if this is set to `true`, CodeRabbit will access models from `us`, `eu`, or `ap` regions based on the AWS_REGION value. +AWS_USE_CROSS_REGION_INFERENCE=[] # if using Anthropic LLM_PROVIDER=anthropic @@ -126,10 +131,20 @@ CODERABBIT_LICENSE_KEY= CODERABBIT_API_KEY= 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=[] + + +# CodeRabbit - KNOWLEDGE BASE +# +# Requisite: To enable CodeRabbit's knowledge base, you need to provide an object store URI. +OBJECT_STORE_URI=[] # All major object stores are supported e.g., s3://bucket/path/to/database, gs://bucket/path/to/database, etc. + +ENABLE_KNOWLEDGE_BASE=[true] # Global feature flag to enable/disable all knowledge base features. + +ENABLE_PRS_INDEX=[true] # Feature flag to enable/disable PRs indexing. +ENABLE_ISSUES_INDEX=[true] # Feature flag to enable/disable Issues indexing. +ENABLE_LEARNING_INDEX=[true] # Feature flag to enable/disable Learning indexing. +ENABLE_CODE_GUIDELINES_INDEX=[true] # Feature flag to enable/disable Code Guidelines indexing. +ENABLE_CODE_INDEX=[true] # Feature flag to enable/disable Code indexing. JIRA_HOST=[] JIRA_PAT=[] @@ -138,6 +153,8 @@ LINEAR_PAT=[] ENABLE_WEB_SEARCH=[true] PERPLEXITY_API_KEY=[] + +YAML_CONFIG=[] ``` :::note @@ -148,6 +165,7 @@ PERPLEXITY_API_KEY=[] - For `GITHUB_HOSTNAME`, use GitHub Enterprise server's hostname, for example, “github.acme-inc.com” - You can generate `CODERABBIT_API_KEY` from CodeRabbit UI -> Organizations Settings -> API Keys. - When `ENABLE_LEARNINGS` is set to `true`, CodeRabbit will use `CODERABBIT_API_KEY` to store learnings on our servers. +- `YAML_CONFIG` is an optional configuration file that can be used to customize CodeRabbit's behavior at the deployment level. It takes the same format as the [CodeRabbit YAML configuration](/docs/getting-started/configure-coderabbit.md) file. It requires the entire YAML file to be in an escaped string format, for example, `YAML_CONFIG="key1: value1\nkey2: value2"`. You can use [Escape YAML](https://escapeyaml.dev/) to generate the escaped string. ::: diff --git a/docs/self-hosted/gitlab.md b/docs/self-hosted/gitlab.md index 42736e2f..1e8121cf 100644 --- a/docs/self-hosted/gitlab.md +++ b/docs/self-hosted/gitlab.md @@ -37,13 +37,46 @@ Consult official CodeRabbitAI documentation for a detailed [guide](https://docs. 1. **Navigate to Add Webhook Page**: Go to the webhook configuration page in the desired GitLab project. 2. **Add Webhook URL**: Enter the URL pointing to the CodeRabbit service, followed by `/gitlab_webhooks` (e.g., `http://127.0.0.1:8080/gitlab_webhooks`). 3. **Generate and Save Secret Token**: Generate a secret token, add it to the webhook, and store it securely. This will be needed for the `.env` file as `GITLAB_WEBHOOK_SECRET` (you can use a single secret token for all projects). -4. Select triggers: +4. **Select triggers**: - Push events - Comments - Issues events - Merge request events +## Add Webhook Using a Script + +We have a convenient [script](/code/gitlab-webhook.sh) to help you add webhooks to a project or all projects under a group in a GitLab instance. + +```bash +# Make sure the script is executable: +chmod +x gitlab-webhook.sh +``` + +Example usage: + +```bash +# PAT example (header auto-detected) +export GITLAB_TOKEN="glpat-xxxxx" +./gitlab-add-webhook.sh \ + -h "gitlab.example.com" -u "http:///gitlab_webhooks" \ + -s "mySecret" -p 42 + +# PAT example (explicit header) +./gitlab-add-webhook.sh \ + -h "gitlab.example.com" -u "http:///gitlab_webhooks" \ + -s "mySecret" -g "mygroup/mysubgroup/myproject" \ + -t "glpat-xxxxx" \ + -A "PRIVATE-TOKEN" + +# OAuth token with explicit header +./gitlab-add-webhook.sh \ + -h "gitlab.example.com" -u "http:///gitlab_webhooks" \ + -s "mySecret" -g "company/backend" \ + -t "eyJhbGciOi..." \ + -A "Authorization: Bearer" +``` + ## Prepare a `.env` file Create a `.env` file with the following content: @@ -62,7 +95,8 @@ LLM_PROVIDER=azure-openai LLM_TIMEOUT=360000 AZURE_OPENAI_ENDPOINT= AZURE_OPENAI_API_KEY= -## it is recommended to deploy gpt-4.1-mini, o4-mini, o3 deployments, gpt-4.1 (optionally). +# it is recommended to deploy text-embedding-3-large, gpt-4.1-mini, o4-mini, o3, gpt-4.1 (optionally). +AZURE_TEXT_EMBEDDING_3_LARGE_DEPLOYMENT_NAME= AZURE_GPT41MINI_DEPLOYMENT_NAME= AZURE_O4MINI_DEPLOYMENT_NAME= AZURE_O3_DEPLOYMENT_NAME= @@ -94,11 +128,15 @@ HTTPS_PROXY=[] NO_PROXY=[] # if using AWS Bedrock +# it is required to have access to claude-3-haiku, claude-3-5-haiku, claude-sonnet-4, claude-opus-4. LLM_PROVIDER=bedrock-anthropic LLM_TIMEOUT=360000 AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_REGION= +# optionally, use cross-region inference to access models in other regions +# if this is set to `true`, CodeRabbit will access models from `us`, `eu`, or `ap` regions based on the AWS_REGION value. +AWS_USE_CROSS_REGION_INFERENCE=[] # if using Anthropic LLM_PROVIDER=anthropic @@ -112,15 +150,29 @@ SELF_HOSTED=gitlab GITLAB_BOT_TOKEN= GITLAB_WEBHOOK_SECRET= +# if seeing '500 Internal Server Error' in CodeRabbit logs when trying to post review comments, +# make sure to set the following environment variable to 1500 (1.5 seconds). +GITLAB_PUBLISH_DELAY=[] CODERABBIT_LICENSE_KEY= CODERABBIT_API_KEY= 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=[] + + +# CodeRabbit - KNOWLEDGE BASE +# +# Requisite: To enable CodeRabbit's knowledge base, you need to provide an object store URI. +OBJECT_STORE_URI=[] # All major object stores are supported e.g., s3://bucket/path/to/database, gs://bucket/path/to/database, etc. + +ENABLE_KNOWLEDGE_BASE=[true] # Global feature flag to enable/disable all knowledge base features. + +ENABLE_PRS_INDEX=[true] # Feature flag to enable/disable PRs indexing. +ENABLE_ISSUES_INDEX=[true] # Feature flag to enable/disable Issues indexing. +ENABLE_LEARNING_INDEX=[true] # Feature flag to enable/disable Learning indexing. +ENABLE_CODE_GUIDELINES_INDEX=[true] # Feature flag to enable/disable Code Guidelines indexing. +ENABLE_CODE_INDEX=[true] # Feature flag to enable/disable Code indexing. + JIRA_HOST=[] JIRA_PAT=[] @@ -129,6 +181,8 @@ LINEAR_PAT=[] ENABLE_WEB_SEARCH=[true] PERPLEXITY_API_KEY=[] + +YAML_CONFIG=[] ``` :::note @@ -136,6 +190,7 @@ PERPLEXITY_API_KEY=[] - If you are using Azure OpenAI, verify that the model deployment names are in the .env file. - Values marked with [] are not optional to provide. - You can generate `CODERABBIT_API_KEY` from CodeRabbit UI -> Organizations Settings -> API Keys. +- `YAML_CONFIG` is an optional configuration file that can be used to customize CodeRabbit's behavior at the deployment level. It takes the same format as the [CodeRabbit YAML configuration](/docs/getting-started/configure-coderabbit.md) file. It requires the entire YAML file to be in an escaped string format, for example, `YAML_CONFIG="key1: value1\nkey2: value2"`. You can use [Escape YAML](https://escapeyaml.dev/) to generate the escaped string. ::: @@ -148,18 +203,18 @@ cat coderabbit.json | docker login -u _json_key --password-stdin us-docker.pkg.d docker pull /coderabbit-agent:latest ``` -### Verify the image is up +## Host the image -You can query `/health` endpoint to verify that the coderabbit-agent service is up and running. +You can host the image on a server, serverless function, or container environment and expose port `8080`. Run the Docker image with the equivalent command on your chosen platform, ensuring you replace the `.env` file path with the path to your actual `.env` file: ```bash -curl 127.0.0.1:8080/health +docker run --env-file .env --publish 127.0.0.1:8080:8080 /coderabbit-agent:latest ``` -## Host the image +### Verify the image is up -You can host the image on a server, serverless function, or container environment and expose port `8080`. Run the Docker image with the equivalent command on your chosen platform, ensuring you replace the `.env` file path with the path to your actual `.env` file: +You can query `/health` endpoint to verify that the coderabbit-agent service is up and running. ```bash -docker run --env-file .env --publish 127.0.0.1:8080:8080 /coderabbit-agent:latest +curl 127.0.0.1:8080/health ``` diff --git a/docs/tools/brakeman.md b/docs/tools/brakeman.md new file mode 100644 index 00000000..d9fac002 --- /dev/null +++ b/docs/tools/brakeman.md @@ -0,0 +1,40 @@ +--- +title: Brakeman +sidebar_label: Brakeman +description: CodeRabbit's guide to Brakeman. +--- + +```mdx-code-block +import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; + + +``` + +[Brakeman](https://brakemanscanner.org/) is a static analysis tool which checks Ruby on Rails applications for security vulnerabilities. It scans your application's code for potential security issues and provides detailed reports about any vulnerabilities it finds. + +## Supported Files + +Brakeman will run on files with the following extensions: + +- `Gemfile` +- `*.rb` +- `*.erb` + +## Features + +Brakeman can detect many critical vulnerabilities such as: + +- SQL injection +- Cross-site scripting (XSS) +- Mass assignment +- Remote code execution +- And many more security vulnerabilities +- Out of date package versions +- Etc + +## Links + +- [Brakeman Official Website](https://brakemanscanner.org/) +- [Brakeman GitHub Repository](https://github.com/presidentbeef/brakeman) +- [Brakeman Documentation](https://brakemanscanner.org/docs/) +- [Warning Types](https://brakemanscanner.org/docs/warning_types/) diff --git a/docs/tools/checkmake.md b/docs/tools/checkmake.md new file mode 100644 index 00000000..8d623ca1 --- /dev/null +++ b/docs/tools/checkmake.md @@ -0,0 +1,30 @@ +--- +title: Checkmake +sidebar_label: Checkmake +description: CodeRabbit's guide to Checkmake. +--- + +```mdx-code-block +import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; + + +``` + +[Checkmake](https://github.com/mrtazz/checkmake) is a linter for Makefiles. + +## Files + +Checkmake will run checks against any `Makefile`. + +## Configuration + +Checkmake supports the following config files: + +- `checkmake.yml` +- `checkmake.yaml` + +CodeRabbit will use the default settings based on the profile selected if no config file is found. + +## Links + +- [Checkmake Configuration](https://github.com/mrtazz/checkmake#configuration) diff --git a/docs/tools/clippy.md b/docs/tools/clippy.md new file mode 100644 index 00000000..257af0e3 --- /dev/null +++ b/docs/tools/clippy.md @@ -0,0 +1,50 @@ +--- +title: Clippy +sidebar_label: Clippy +description: CodeRabbit's guide to Clippy. +--- + +```mdx-code-block +import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; + + +``` + +[Clippy](https://github.com/rust-lang/rust-clippy) is a collection of lints to catch common mistakes and improve your Rust code. It is the official linter for the Rust programming language. + +## Supported Files + +Clippy will run on files with the following extensions: + +- `*.rs` + +## Configuration + +Clippy supports the following configuration files: + +- `clippy.toml` +- `.clippy.toml` + +:::note + +Clippy does not require configuration to run. If no configuration file is found, it will use default settings. + +A Cargo.toml is required. + +::: + +## Features + +Clippy can detect many code quality issues such as: + +- Style violations +- Common mistakes +- Performance issues +- Deprecated code patterns +- And many more Rust-specific issues + +## Links + +- [Clippy GitHub Repository](https://github.com/rust-lang/rust-clippy) +- [Clippy Documentation](https://rust-lang.github.io/rust-clippy/master/) +- [Available Lints](https://rust-lang.github.io/rust-clippy/master/index.html) diff --git a/docs/tools/dotenv.md b/docs/tools/dotenv.md new file mode 100644 index 00000000..a3a2dfd2 --- /dev/null +++ b/docs/tools/dotenv.md @@ -0,0 +1,42 @@ +--- +title: Dotenv Linter +sidebar_label: Dotenv Linter +description: CodeRabbit's guide to Dotenv Linter. +--- + +```mdx-code-block +import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; + + +``` + +[Dotenv Linter](https://github.com/dotenv-linter/dotenv-linter) is a lightning-fast linter for `.env` files. It helps ensure your environment files are consistent, typo-free, and follow best practices. + +## Files + +Dotenv Linter will run on files with the following patterns: + +- `**/.env` +- `**/.env.*` + +We will not run against files that do not start with `.env` (e.g., `test.env`). However `.env.dev` or `.env.local` is fine. + +:::note + +Dotenv Linter does not require configuration to run and automatically anlysises `.env` files. If no configuration file is found, it will use default settings. + +::: + +## Features + +Dotenv Linter can detect: + +- Key duplication +- Missing values +- Incorrect formatting +- Invalid characters +- And many more issues + +## Links + +- [Dotenv Linter GitHub Repository](https://github.com/dotenv-linter/dotenv-linter) diff --git a/docs/tools/flake8.md b/docs/tools/flake8.md new file mode 100644 index 00000000..a1a18881 --- /dev/null +++ b/docs/tools/flake8.md @@ -0,0 +1,46 @@ +--- +title: Flake8 +sidebar_label: Flake8 +description: CodeRabbit's guide to Flake8. +--- + +```mdx-code-block +import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; + + +``` + +[Flake8](https://flake8.pycqa.org/) is a Python linting utility that wraps PyFlakes, pycodestyle, and Mccabe to check your Python or Jupiter Notebook code for style and logical errors. + +## Supported Files + +Flake8 will run on files with the following extensions: + +- `*.py` +- `*.ipynb` (using nbqa) + +## Configuration + +Flake8 supports the following config files: + +- `.flake8` + +CodeRabbit will not run Flake8 if no config file is found. + +## Features + +Flake8 can detect many issues such as: + +- Style violations (PEP 8) +- Logical errors and unused imports +- Code complexity issues +- Syntax errors +- And many more + +## Links + +- [Flake8 Official Website](https://flake8.pycqa.org/) +- [Flake8 GitHub Repository](https://github.com/pycqa/flake8) +- [Flake8 Documentation](https://flake8.pycqa.org/en/latest/) +- [Flake8 Configuration](https://flake8.pycqa.org/en/latest/user/configuration.html) +- [nbqa Documentation](https://github.com/nbQA-dev/nbQA) diff --git a/docs/tools/htmlhint.md b/docs/tools/htmlhint.md new file mode 100644 index 00000000..c8fd61ea --- /dev/null +++ b/docs/tools/htmlhint.md @@ -0,0 +1,31 @@ +--- +title: HTMLHint +sidebar_label: HTMLHint +description: CodeRabbit's guide to HTMLHint. +--- + +```mdx-code-block +import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; + + +``` + +[HTMLHint](https://htmlhint.com/) is a static code analysis tool for HTML. + +## Files + +HTMLHint will run checks against `*.html` files. + +## Configuration + +HTMLHint supports the following config files: + +- `.htmlhintrc` +- `.htmlhintrc.json` +- `htmlhintrc.json` + +CodeRabbit will use the default settings based on the profile selected if no config file is found. + +## Links + +- [HTMLHint Configuration](https://htmlhint.com/docs/user-guide/getting-started) diff --git a/docs/tools/list.md b/docs/tools/list.md new file mode 100644 index 00000000..f81880a3 --- /dev/null +++ b/docs/tools/list.md @@ -0,0 +1,90 @@ +--- +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 | +| Environment Files (.env) | [Dotenv Linter][DotenvLinter] | Code Quality | +| 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 | +| HTML | [HTMLHint][HTMLHint] | Code Quality | +| 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 | +| Makefile | [Checkmake][Checkmake] | Code Quality | +| Markdown | [markdownlint][markdownlint], [LanguageTool][LanguageTool] | Code Quality, Grammar Checking | +| PHP | [PHPStan][PHPStan], [PHPMD][PHPMD], [PHPCS][PHPCS] | Code Quality | +| Plaintext | [LanguageTool][LanguageTool] | Grammar and Spell Checking | +| Java | [PMD][PMD] | Code Quality | +| Protobuf | [Buf][Buf] | Code Quality | +| Python | [Ruff][Ruff], [Pylint][Pylint], [Flake8][Flake8] | Code Quality | +| Jupyter Notebooks | [Ruff][Ruff], [Pylint][Pylint], [Flake8][Flake8] | Code Quality | +| Regal | [Regal][Regal] | Code Quality | +| Ruby | [RuboCop][RuboCop], [Brakeman][Brakeman] | Code Quality, Code Security | +| Rust | [Clippy][Clippy] | 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 +[Brakeman]: /tools/brakeman.md +[Clippy]: /tools/clippy.md +[Pylint]: /tools/pylint.md +[DotenvLinter]: /tools/dotenv.md +[HTMLHint]: /tools/htmlhint.md +[Checkmake]: /tools/checkmake.md +[PHPMD]: /tools/phpmd.md +[PHPCS]: /tools/phpcs.md +[Flake8]: /tools/flake8.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/phpcs.md b/docs/tools/phpcs.md new file mode 100644 index 00000000..468e23dc --- /dev/null +++ b/docs/tools/phpcs.md @@ -0,0 +1,56 @@ +--- +title: PHPCS +sidebar_label: PHPCS +description: CodeRabbit's guide to PHPCS. +--- + +```mdx-code-block +import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; + + +``` + +[PHPCS](https://github.com/squizlabs/PHP_CodeSniffer) (PHP CodeSniffer) is a development tool that ensures your code conforms to a coding standard. It is an essential tool for any development team that wants to ensure their code is consistent and follows best practices. + +## Files + +PHPCS will run on files with the following extensions: + +- `.php` + +## Features + +PHPCS can detect and fix various coding standard violations including: + +- **PSR Standards**: Enforces PSR-1, PSR-2, PSR-12, and other coding standards +- **Custom Standards**: Supports custom coding standards and rules +- **Auto-fixing**: Can automatically fix many coding standard violations +- **Custom Rules**: Allows creation of custom sniff rules +- **Multiple Standards**: Can enforce multiple coding standards simultaneously + +## Popular Standards + +PHPCS supports many coding standards including: + +- **PSR-1**: Basic Coding Standard +- **PSR-2**: Coding Style Guide +- **PSR-12**: Extended Coding Style +- **Squiz**: Squiz Labs coding standard +- **PEAR**: PEAR coding standard +- **Zend**: Zend Framework coding standard + +## Configuration + +PHPCS requires a configuration file to run. CodeRabbit will only run PHPCS if one of the following configuration files is found: + +- `phpcs.xml` - XML configuration file +- `phpcs.xml.dist` - Distributed XML configuration file + +CodeRabbit will not run PHPCS if no configuration file is found. + +## Links + +- [PHPCS GitHub Repository](https://github.com/squizlabs/PHP_CodeSniffer) +- [PHPCS Documentation](https://github.com/squizlabs/PHP_CodeSniffer/wiki) +- [Available Coding Standards](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Coding-Standards) +- [Creating Custom Standards](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Coding-Standards#creating-a-coding-standard) diff --git a/docs/tools/phpmd.md b/docs/tools/phpmd.md new file mode 100644 index 00000000..84df5b11 --- /dev/null +++ b/docs/tools/phpmd.md @@ -0,0 +1,44 @@ +--- +title: PHPMD +sidebar_label: PHPMD +description: CodeRabbit's guide to PHPMD. +--- + +```mdx-code-block +import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; + + +``` + +[PHPMD](https://phpmd.org/) (PHP Mess Detector) is a static analysis tool for PHP that detects potential problems in your code such as possible bugs, suboptimal code, overcomplicated expressions, and unused parameters, variables, methods, and classes. + +## Files + +PHPMD will run on files with the following extensions: + +- `.php` + +## Features + +PHPMD can detect various code quality issues including: + +- **Clean Code Rules**: Detects code smells and violations of clean code principles +- **Controversial Rules**: Identifies potentially problematic code patterns +- **Design Rules**: Finds design-related issues and architectural problems +- **Naming Rules**: Checks for naming convention violations +- **Unused Code Rules**: Detects unused variables, parameters, methods, and classes +- **Size Rules**: Identifies overly complex methods and classes + +### Review Mode Behavior + +CodeRabbit's review mode affects which PHPMD rules are applied: + +- **Chill Mode**: Only checks for unused code (`unusedcode` rule set) +- **Nitpick Mode**: Checks all rule sets including clean code, code size, controversial rules, design issues, naming conventions, and unused code (`cleancode,codesize,controversial,design,naming,unusedcode`) + +## Links + +- [PHPMD Official Website](https://phpmd.org/) +- [PHPMD GitHub Repository](https://github.com/phpmd/phpmd) +- [PHPMD Documentation](https://phpmd.org/documentation/index.html) +- [Available Rules](https://phpmd.org/rules/index.html) diff --git a/docs/tools/pylint.md b/docs/tools/pylint.md new file mode 100644 index 00000000..6c45484d --- /dev/null +++ b/docs/tools/pylint.md @@ -0,0 +1,50 @@ +--- +title: Pylint +sidebar_label: Pylint +description: CodeRabbit's guide to Pylint. +--- + +```mdx-code-block +import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; + + +``` + +[Pylint](https://pylint.pycqa.org/) is a static code analysis tool for Python or Jupiter Notebooks. It checks your Python code for errors, enforces a coding standard, and looks for code smells. + +## Supported Files + +Pylint will run on files with the following extensions: + +- `*.py` +- `.ipynb` (using nbqa) + +## Configuration + +Pylint supports the following config files: + +- `.pylintrc` +- `pylintrc` +- `.pylintrc.toml` +- `pylintrc.toml` + +CodeRabbit will not run Pylint if no config file is found. + +## Features + +Pylint can detect many issues such as: + +- Coding standard violations (PEP8) +- Unused variables and imports +- Undefined variables +- Code smells and refactoring suggestions +- Error-prone constructs +- And many more + +## Links + +- [Pylint Official Website](https://pylint.pycqa.org/) +- [Pylint GitHub Repository](https://github.com/pylint-dev/pylint) +- [Pylint Documentation](https://pylint.pycqa.org/en/latest/) +- [Message Control](https://pylint.pycqa.org/en/latest/user_guide/message-control.html) +- [nbqa Documentation](https://github.com/nbQA-dev/nbQA) diff --git a/docs/tools/ruff.md b/docs/tools/ruff.md index fe897d7b..97ebacde 100644 --- a/docs/tools/ruff.md +++ b/docs/tools/ruff.md @@ -10,13 +10,14 @@ import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; ``` -[Ruff](https://docs.astral.sh/ruff/) is a linter for Python. +[Ruff](https://docs.astral.sh/ruff/) is a linter for Python or Jupiter Notebooks. ## Files Ruff will run on files with the following extensions: - `.py` +- `.ipynb` (using nbqa) ## Configuration @@ -31,3 +32,4 @@ CodeRabbit will use the default settings based on the profile selected if no con ## Links - [Ruff Configuration](https://docs.astral.sh/ruff/configuration/) +- [nbqa Documentation](https://github.com/nbQA-dev/nbQA) diff --git a/docs/tools/shopify-cli.md b/docs/tools/shopify-cli.md index 934a6345..cc574723 100644 --- a/docs/tools/shopify-cli.md +++ b/docs/tools/shopify-cli.md @@ -12,6 +12,31 @@ import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; [Shopify CLI](https://github.com/Shopify/cli) is a command-line tool that helps you build Shopify apps, themes, and custom storefronts. It provides functionality for initializing, building, developing, and deploying Shopify projects. +## Requirements + +The tool only runs when the following conditions are met: + +### File Types + +- Only processes pull requests changing `*.liquid` files + +### Configuration Files + +- Requires either `.theme-check.yml` or `.theme-check.yaml` configuration file in the project root + +### Directory Structure + +- Requires the standard Shopify theme directory structure at the project root: + - `assets/` + - `config/` + - `layout/` + - `locales/` + - `sections/` + - `snippets/` + - `templates/` + +If any of these requirements are not met, the tool will not run. + ## Validation Rules The tool checks for: diff --git a/docs/tools/tools.md b/docs/tools/tools.md index 113c2fee..45b376c5 100644 --- a/docs/tools/tools.md +++ b/docs/tools/tools.md @@ -3,6 +3,8 @@ title: Configure third-party tool use description: Overview of CodeRabbit's supported linters and security analysis tools. --- +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'; @@ -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], [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 | -| 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]: ./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 -[oxlint]: ./oxlint.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 1869c24c..487a363b 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -30,13 +30,13 @@ const sidebars: SidebarsConfig = { docsSidebar: [ { type: "category", - collapsed: false, + collapsed: true, label: "Get started with CodeRabbit", items: ["overview/introduction", "getting-started/quickstart"], }, { type: "category", - collapsed: false, + collapsed: true, label: "Add CodeRabbit to your repository", items: [ "platforms/platforms", @@ -70,36 +70,52 @@ const sidebars: SidebarsConfig = { }, { type: "category", - collapsed: false, + collapsed: true, + label: "Manage your account", + items: ["getting-started/subscription-management", "guides/roles"], + }, + { + type: "category", + collapsed: true, label: "Configure CodeRabbit", items: [ + "guides/configuration-overview", + "guides/organization-settings", + "guides/repository-settings", "getting-started/configure-coderabbit", + "guides/initial-configuration", "integrations/knowledge-base", + "guides/learnings", "guides/review-instructions", "tools/tools", + "guides/roles", ], }, { type: "category", - collapsed: false, + collapsed: true, label: "Review pull requests", items: [ + "guides/code-review-overview", "guides/commands", + "guides/generate-improvements", + "guides/code-review-troubleshooting", "guides/agent_chat", { type: "category", - collapsed: false, + collapsed: true, label: "Analyze and improve your code", items: [ "integrations/code-graph-analysis", "finishing-touches/docstrings", + "finishing-touches/unit-test-generation", ], }, ], }, { type: "category", - collapsed: false, + collapsed: true, label: "Create and resolve issues", items: [ "integrations/issue-integrations", @@ -110,29 +126,40 @@ const sidebars: SidebarsConfig = { }, { type: "category", - collapsed: false, + collapsed: true, label: "Review local changes", items: [ "guides/about-vscode", "guides/install-vscode", "guides/use-vscode", + "guides/use-vscode-selfhosted", "guides/config-vscode", "guides/uninstall-vscode", ], }, { type: "category", - collapsed: false, + collapsed: true, label: "Generate reports", items: [ + "guides/reports-overview", + "guides/scheduled-reports", "guides/ondemand-reports", "guides/custom-reports", - "guides/scheduled-reports", ], }, { type: "category", - collapsed: false, + collapsed: true, + label: "Best practices", + items: [ + "guides/setup-best-practices", + "guides/code-review-best-practices", + ], + }, + { + type: "category", + collapsed: true, label: "Reference", items: [ { @@ -140,29 +167,43 @@ const sidebars: SidebarsConfig = { label: "CodeRabbit API", href: "https://api.coderabbit.ai/api/swagger/", }, + "reference/review-commands", + "reference/configuration", + "reference/yaml-template", { type: "category", label: "Supported tools", collapsed: true, items: [ + "tools/list", "tools/actionlint", "tools/biome", + "tools/brakeman", "tools/buf", + "tools/checkmake", "tools/checkov", "tools/circleci", + "tools/clippy", "tools/cppcheck", "tools/detekt", + "tools/dotenv", "tools/eslint", + "tools/flake8", "tools/gitleaks", "tools/golangci-lint", "tools/hadolint", + "tools/htmlhint", "tools/languagetool", + "tools/luacheck", "tools/markdownlint", "tools/oxlint", + "tools/phpcs", + "tools/phpmd", "tools/phpstan", "tools/pipeline-remediation", "tools/pmd", "tools/prisma-lint", + "tools/pylint", "tools/regal", "tools/rubocop", "tools/ruff", @@ -173,15 +214,15 @@ const sidebars: SidebarsConfig = { "tools/yamllint", ], }, + "reference/caching", ], }, { type: "category", - collapsed: false, + collapsed: true, label: "Resources", items: [ "getting-started/support", - "getting-started/subscription-management", "overview/why-coderabbit", "faq", "early-access", diff --git a/src/css/custom.css b/src/css/custom.css index 4a77db0a..7365089e 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -39,6 +39,8 @@ --ifm-navbar-height: 5rem; --ifm-font-family-base: "Poppins", "Work Sans", sans-serif; --ifm-background-color-primary: #f6f6f1; + --ifm-background-color-secondary: #e8e8e8; + --ifm-breadcrumb-item-background-active: #ffe9e2; } [data-theme="dark"] { @@ -51,6 +53,8 @@ --ifm-color-primary-lightest: #171717; --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); --ifm-background-color-primary: #171717; + --ifm-background-color-secondary: #232323; + --ifm-breadcrumb-item-background-active: #3f322e; } #__docusaurus { @@ -102,6 +106,8 @@ a[docid="docs"] > svg { overflow: hidden; max-width: 100%; background: #000; + border-radius: 1rem; + border: 4px solid var(--ifm-background-color-secondary); } .video-container iframe { @@ -293,3 +299,39 @@ a[docid="docs"] > svg { display: none; } } + +/* Disable automatic next/previous pagination links */ +.pagination-nav { + display: none; +} +/* ===== MARKDOWN STYLES ===== */ +.theme-doc-markdown.markdown { + line-height: 1.8rem; +} +/* ===== BREADCRUMB STYLES ===== */ + +.breadcrumbs { + display: flex; + gap: 0.5rem; + overflow-x: auto; + white-space: nowrap; +} +.breadcrumbs::-webkit-scrollbar { + display: none; +} +.breadcrumbs__item { + display: flex; + align-items: center; + white-space: nowrap; + gap: 1rem; +} +.breadcrumbs__link { + transition: color 0.2s ease; + background-color: var(--ifm-background-color-secondary); +} + +.breadcrumbs__item--active .breadcrumbs__link { + font-weight: 600; + cursor: default; + background-color: var(--ifm-breadcrumb-item-background-active); +} diff --git a/static/code/gitlab-webhook.sh b/static/code/gitlab-webhook.sh new file mode 100755 index 00000000..87c3be7d --- /dev/null +++ b/static/code/gitlab-webhook.sh @@ -0,0 +1,297 @@ +#!/usr/bin/env bash + +## gitlab-webhook.sh +# Add a webhook to one project, or every project in a subgroup tree. + +## Example usage: +# Make sure the script is executable: +# chmod +x gitlab-webhook.sh + +# PAT auto-detected header +# export GITLAB_TOKEN="glpat-xxxxx" +# ./gitlab-add-webhook.sh \ +# -h "gitlab.example.com" -u "https://ci.example.com/gitlab-hook" \ +# -s "mySecret" -p 42 + +# PAT with explicit header +# ./gitlab-add-webhook.sh \ +# -h "gitlab.example.com" -u "https://ci.example.com/gitlab-hook" \ +# -s "mySecret" -g "mygroup/mysubgroup/myproject" \ +# -t "glpat-qj5s..." \ +# -A "PRIVATE-TOKEN" + +# OAuth token with explicit header +# ./gitlab-add-webhook.sh \ +# -h "gitlab.example.com" -u "https://ci.example.com/gitlab-hook" \ +# -s "mySecret" -g "company/backend" \ +# -t "eyJhbGciOi..." \ +# -A "Authorization: Bearer" + + +set -euo pipefail + +usage() { + cat < -u -s \\ + [-t ] [-A ] [-p | -g ] [-v] + +Required: + -h GitLab host (e.g. gitlab.example.com) + -u Webhook endpoint URL to receive POSTs + -s Webhook secret token (used for signature verification) + +Authentication (one of): + -t Access token (PAT, project, group or OAuth). If omitted, \$GITLAB_TOKEN is used + -A Auth header to use. Default detects: + PAT → "PRIVATE-TOKEN" + anything else → "Authorization: Bearer" + +Scope (choose one): + -p Project ID or full path (e.g. 42 or group/app) + -g Group ID or full path, recurse through all subgroups & projects + +Options: + -v Verbose output (show individual project IDs in final summary) +EOF + exit 1 +} + +HOST="" HOOK_URL="" HOOK_SECRET="" +TOKEN="${GITLAB_TOKEN:-}" AUTH_HEADER="" +PROJECT="" GROUP="" VERBOSE=false + +while getopts "h:u:s:t:A:p:g:v" opt; do + case "$opt" in + h) HOST=$OPTARG ;; + u) HOOK_URL=$OPTARG ;; + s) HOOK_SECRET=$OPTARG ;; + t) TOKEN=$OPTARG ;; + A) AUTH_HEADER=$OPTARG ;; + p) PROJECT=$OPTARG ;; + g) GROUP=$OPTARG ;; + v) VERBOSE=true ;; + *) usage ;; + esac +done + +# Mandatory checks +[[ -z $HOST || -z $HOOK_URL || -z $HOOK_SECRET ]] && usage +[[ -n $PROJECT && -n $GROUP ]] && usage +[[ -z $PROJECT && -z $GROUP ]] && usage + +# Token handling +if [[ -z $TOKEN ]]; then + echo "[ERROR] No access token provided. Use -t or set \$GITLAB_TOKEN" >&2 + exit 1 +fi + +# Choose header if not forced +if [[ -z $AUTH_HEADER ]]; then + if [[ $TOKEN == glpat-* || $TOKEN == "PAT-"* ]]; then + AUTH_HEADER="PRIVATE-TOKEN" + else + AUTH_HEADER="Authorization: Bearer" + fi +fi + +API="https://${HOST}/api/v4" +CURL_BASE=(curl -sSf --header "${AUTH_HEADER}: ${TOKEN}") + +# Track processed projects to avoid duplicates +declare -A PROCESSED_PROJECTS +# Track projects where webhooks were successfully added +WEBHOOK_PROJECTS=() +# Track projects where webhooks already existed +EXISTING_WEBHOOK_PROJECTS=() +# Progress counters +TOTAL_PROJECTS_FOUND=0 +PROJECTS_PROCESSED=0 + +############################################################################## +# Helpers +############################################################################## +url_encode() { + local string="$1" + # URL encode the string using printf and sed + printf '%s' "$string" | sed 's/\//%2F/g; s/ /%20/g; s/@/%40/g; s/:/%3A/g; s/#/%23/g; s/?/%3F/g; s/&/%26/g; s/=/%3D/g; s/+/%2B/g' +} + +# Function to handle paginated API calls +fetch_paginated() { + local url=$1 + local page=1 + local per_page=100 + + while true; do + local paginated_url="${url}?per_page=${per_page}&page=${page}" + + # Add existing query params if they exist + if [[ "$url" == *"?"* ]]; then + paginated_url="${url}&per_page=${per_page}&page=${page}" + fi + + local response + response=$("${CURL_BASE[@]}" "$paginated_url" 2>/dev/null) || { + echo "[ERROR] Failed to fetch page $page from $url" >&2 + return 1 + } + + # Check if response is empty array or null + if [[ "$response" == "[]" || "$response" == "null" ]]; then + break + fi + + # Extract results from current page + local page_results + page_results=$(echo "$response" | jq -r '.[].id' 2>/dev/null) || { + echo "[ERROR] Failed to parse JSON response from page $page" >&2 + return 1 + } + + # If no results on this page, we're done + if [[ -z "$page_results" ]]; then + break + fi + + # Count projects found and show progress + local page_count + page_count=$(echo "$page_results" | wc -l) + TOTAL_PROJECTS_FOUND=$((TOTAL_PROJECTS_FOUND + page_count)) + echo "[PROGRESS] Found $page_count projects on page $page (total: $TOTAL_PROJECTS_FOUND)" >&2 + + # Output page results + echo "$page_results" + + # If we got less than per_page results, we're on the last page + local item_count + item_count=$(echo "$response" | jq '. | length' 2>/dev/null) || 0 + if [[ "$item_count" -lt "$per_page" ]]; then + break + fi + + ((page++)) + done +} + +create_hook() { + local pid=$1 + + # Skip if already processed + if [[ -n "${PROCESSED_PROJECTS[$pid]:-}" ]]; then + return 0 + fi + + # Mark as processed + PROCESSED_PROJECTS[$pid]=1 + PROJECTS_PROCESSED=$((PROJECTS_PROCESSED + 1)) + + local encoded_pid + # URL encode if pid is not purely numeric + if [[ $pid =~ ^[0-9]+$ ]]; then + encoded_pid=$pid + else + encoded_pid=$(url_encode "$pid") + fi + + # Check if webhook already exists + local existing_webhooks + existing_webhooks=$("${CURL_BASE[@]}" "${API}/projects/${encoded_pid}/hooks" 2>/dev/null) || { + echo "[ERROR] Failed to fetch existing webhooks for project $pid" >&2 + return 1 + } + + # Check if our webhook URL already exists + if echo "$existing_webhooks" | jq -e --arg url "$HOOK_URL" '.[] | select(.url == $url)' >/dev/null 2>&1; then + [[ "$VERBOSE" == "true" ]] && echo "[INFO] Webhook already exists for project: $pid" >&2 + EXISTING_WEBHOOK_PROJECTS+=("$pid") + return 0 + fi + + [[ "$VERBOSE" == "true" ]] && echo "[INFO] Adding webhook to project: $pid" >&2 + + "${CURL_BASE[@]}" --request POST \ + --data-urlencode "url=${HOOK_URL}" \ + --data "token=${HOOK_SECRET}" \ + --data "push_events=true" \ + --data "note_events=true" \ + --data "issues_events=true" \ + --data "merge_requests_events=true" \ + --data "enable_ssl_verification=true" \ + "${API}/projects/${encoded_pid}/hooks" \ + >/dev/null + + # Track successful webhook creation + WEBHOOK_PROJECTS+=("$pid") +} + +traverse_group() { + local gid=$1 + local encoded_gid + # URL encode if gid is not purely numeric + if [[ $gid =~ ^[0-9]+$ ]]; then + encoded_gid=$gid + else + encoded_gid=$(url_encode "$gid") + fi + + # projects (includes nested sub-groups) - with pagination + while IFS= read -r pid; do + [[ -n "$pid" ]] && create_hook "$pid" + done < <( + fetch_paginated "${API}/groups/${encoded_gid}/projects?include_subgroups=true" + ) + + # recurse explicit subgroups (older GitLab) - with pagination + while IFS= read -r sg; do + [[ -n "$sg" ]] && traverse_group "$sg" + done < <( + fetch_paginated "${API}/groups/${encoded_gid}/subgroups" + ) +} + +############################################################################## +# Main +############################################################################## +echo "[INFO] Starting webhook processing..." >&2 + +if [[ -n $PROJECT ]]; then + echo "[INFO] Processing single project: $PROJECT" >&2 + create_hook "$PROJECT" +else + echo "[INFO] Processing group and subgroups: $GROUP" >&2 + traverse_group "$GROUP" +fi + +echo "[INFO] Finished processing all projects" >&2 + +# Print final summary +total_projects=$((${#WEBHOOK_PROJECTS[@]} + ${#EXISTING_WEBHOOK_PROJECTS[@]})) + +if [[ $total_projects -eq 0 ]]; then + echo "[INFO] No projects were processed" +else + if [[ ${#WEBHOOK_PROJECTS[@]} -gt 0 ]]; then + if [[ "$VERBOSE" == "true" ]]; then + echo "[INFO] Webhooks installed successfully on ${#WEBHOOK_PROJECTS[@]} project(s):" + for pid in "${WEBHOOK_PROJECTS[@]}"; do + echo " - Project ID: $pid" + done + else + echo "[INFO] Webhooks installed successfully on ${#WEBHOOK_PROJECTS[@]} project(s)" + fi + fi + + if [[ ${#EXISTING_WEBHOOK_PROJECTS[@]} -gt 0 ]]; then + if [[ "$VERBOSE" == "true" ]]; then + echo "[INFO] Webhooks already existed on ${#EXISTING_WEBHOOK_PROJECTS[@]} project(s):" + for pid in "${EXISTING_WEBHOOK_PROJECTS[@]}"; do + echo " - Project ID: $pid" + done + else + echo "[INFO] Webhooks already existed on ${#EXISTING_WEBHOOK_PROJECTS[@]} project(s)" + fi + fi + + echo "[INFO] Total projects processed: $total_projects" +fi diff --git a/static/img/finishing-touches/utg.gif b/static/img/finishing-touches/utg.gif new file mode 100644 index 00000000..4d685239 Binary files /dev/null and b/static/img/finishing-touches/utg.gif differ diff --git a/static/img/guides/path-filters.png b/static/img/guides/path-filters.png new file mode 100644 index 00000000..9f398a51 Binary files /dev/null and b/static/img/guides/path-filters.png differ diff --git a/static/img/guides/score-card-report-result.png b/static/img/guides/score-card-report-result.png new file mode 100644 index 00000000..15b51539 Binary files /dev/null and b/static/img/guides/score-card-report-result.png differ diff --git a/static/img/guides/score-card-result-comment.png b/static/img/guides/score-card-result-comment.png new file mode 100644 index 00000000..1ea43248 Binary files /dev/null and b/static/img/guides/score-card-result-comment.png differ diff --git a/static/img/guides/score-card-trigger-comment.png b/static/img/guides/score-card-trigger-comment.png new file mode 100644 index 00000000..2f690948 Binary files /dev/null and b/static/img/guides/score-card-trigger-comment.png differ diff --git a/static/img/guides/where-score-report-prompt-go.png b/static/img/guides/where-score-report-prompt-go.png new file mode 100644 index 00000000..3b26a1f1 Binary files /dev/null and b/static/img/guides/where-score-report-prompt-go.png differ diff --git a/static/img/integrations/login-self-hosted-github.png b/static/img/integrations/login-self-hosted-github.png index 99f511c6..35e76ed1 100644 Binary files a/static/img/integrations/login-self-hosted-github.png and b/static/img/integrations/login-self-hosted-github.png differ diff --git a/static/img/integrations/self-hosted-github-host-url.png b/static/img/integrations/self-hosted-github-host-url.png index b8224720..2cb6d671 100644 Binary files a/static/img/integrations/self-hosted-github-host-url.png and b/static/img/integrations/self-hosted-github-host-url.png differ diff --git a/static/img/knowledge-base/code-guidelines.png b/static/img/knowledge-base/code-guidelines.png new file mode 100644 index 00000000..638a656f Binary files /dev/null and b/static/img/knowledge-base/code-guidelines.png differ diff --git a/static/img/reference/path-instructions.png b/static/img/reference/path-instructions.png new file mode 100644 index 00000000..adcb5884 Binary files /dev/null and b/static/img/reference/path-instructions.png differ diff --git a/static/schema/schema.v2.json b/static/schema/schema.v2.json index 1379587b..b31867ae 100644 --- a/static/schema/schema.v2.json +++ b/static/schema/schema.v2.json @@ -95,7 +95,17 @@ "de-LU", "fr-FR", "bg-BG", - "bg" + "bg", + "he-IL", + "he", + "hi-IN", + "hi", + "vi-VN", + "vi", + "th-TH", + "th", + "bn-BD", + "bn" ], "default": "en-US", "description": "Set the language for reviews by using the corresponding ISO language code." @@ -185,6 +195,11 @@ "default": true, "description": "Generate sequence diagrams in the walkthrough." }, + "estimate_code_review_effort": { + "type": "boolean", + "default": true, + "description": "Estimate the code review effort in the walkthrough." + }, "assess_linked_issues": { "type": "boolean", "default": true, @@ -312,7 +327,7 @@ "type": "string" }, "default": [], - "description": "Restrict automatic reviews to only those pull requests that match one of the specified labels." + "description": "List of labels to control which PRs/MRs to review. Labels starting with '!' are negative matches. Examples: ['bug', 'feature'] - reviews PRs with 'bug' OR 'feature' label. ['!wip'] - reviews all PRs except those with 'wip' label. ['bug', '!wip'] - reviews PRs with 'bug' label but not if they have 'wip' label." }, "drafts": { "type": "boolean", @@ -346,6 +361,94 @@ "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, + "default": {} + }, + "pre_merge_checks": { + "type": "object", + "properties": { + "docstrings": { + "type": "object", + "properties": { + "mode": { + "type": "string", + "enum": ["off", "warning", "error"], + "default": "warning", + "description": "Mode | Level of enforcement for docstring coverage check. Warning only generates a warning and does not require the user to resolve the check. While error requires the user to resolve issues before merging pull request." + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 100, + "default": 80, + "description": "Percentage threshold for docstring coverage check." + } + }, + "additionalProperties": false, + "default": {}, + "description": "Docstring Coverage | Checks if the code has sufficient docstrings." + }, + "title": { + "type": "object", + "properties": { + "mode": { + "type": "string", + "enum": ["off", "warning", "error"], + "default": "warning", + "description": "Mode | Level of enforcement for pull request title check. Warning only generates a warning and does not require the user to resolve the check. While error requires the user to resolve issues before merging pull request." + }, + "requirements": { + "type": "string", + "default": "", + "description": "Requirements | Requirements for the pull request title. Example: 'Title should be concise and descriptive, ideally under 50 characters.'" + } + }, + "additionalProperties": false, + "default": {}, + "description": "Title Check | Checks if the pull request title is appropriate and follows best practices." + }, + "description": { + "type": "object", + "properties": { + "mode": { + "type": "string", + "enum": ["off", "warning", "error"], + "default": "warning", + "description": "Mode | Level of enforcement for pull request description check. Warning only generates a warning and does not require the user to resolve the check. While error requires the user to resolve issues before merging pull request." + } + }, + "additionalProperties": false, + "default": {}, + "description": "Description Check | Checks if the pull request description is appropriate and follows best practices." + }, + "issue_assessment": { + "type": "object", + "properties": { + "mode": { + "type": "string", + "enum": ["off", "warning", "error"], + "default": "warning", + "description": "Mode | Level of enforcement for linked issue assessment. Warning only generates a warning and does not require the user to resolve the check. While error requires the user to resolve issues before merging pull request." + } + }, + "additionalProperties": false, + "default": {}, + "description": "Linked Issue Assessment | Checks if the pull request addresses the linked issues. Generate an assessment of how well the changes address the linked issues." } }, "additionalProperties": false, @@ -389,7 +492,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.38.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.6" }, "shellcheck": { "type": "object", @@ -410,7 +513,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable Ruff | Ruff is a Python linter and code formatter. | Enable Ruff integration. | v0.11.9" + "description": "Enable Ruff | Ruff is a Python linter and code formatter. | Enable Ruff integration. | v0.12.2" } }, "additionalProperties": false, @@ -443,7 +546,7 @@ "maximum": 900000, "minimum": 0, "default": 90000, - "description": "Time in milliseconds to wait for all GitHub Checks to conclude." + "description": "Time in milliseconds to wait for all GitHub Checks to conclude. Default 90 seconds, max 15 minutes (900000ms)." } }, "additionalProperties": false, @@ -512,7 +615,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable Biome | Biome is a fast formatter, linter, and analyzer for web projects. | Enable Biome integration. | v1.9.4" + "description": "Enable Biome | Biome is a fast formatter, linter, and analyzer for web projects. | Enable Biome integration. | v2.1.2" } }, "additionalProperties": false, @@ -555,7 +658,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.1.15" + "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.17" }, "level": { "type": "string", @@ -581,13 +684,39 @@ "default": {}, "description": "PHPStan is a tool to analyze PHP code." }, + "phpmd": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": true, + "description": "Enable PHPMD | PHPMD is a tool to find potential problems in PHP code. | v2.15.0" + } + }, + "additionalProperties": false, + "default": {}, + "description": "PHPMD is a tool to find potential problems in PHP code." + }, + "phpcs": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": true, + "description": "Enable PHP CodeSniffer | PHP CodeSniffer is a PHP linter and coding standard checker. | v3.7.2" + } + }, + "additionalProperties": false, + "default": {}, + "description": "PHP CodeSniffer is a PHP linter and coding standard checker." + }, "golangci-lint": { "type": "object", "properties": { "enabled": { "type": "boolean", "default": true, - "description": "Enable golangci-lint | golangci-lint is a fast linters runner for Go. | Enable golangci-lint integration. | v1.64.8" + "description": "Enable golangci-lint | golangci-lint is a fast linters runner for Go. | Enable golangci-lint integration. | v2.2.2" }, "config_file": { "type": "string", @@ -617,7 +746,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable Gitleaks | Gitleaks is a secret scanner. | Enable Gitleaks integration. | v8.26.0" + "description": "Enable Gitleaks | Gitleaks is a secret scanner. | Enable Gitleaks integration. | v8.27.2" } }, "additionalProperties": false, @@ -667,13 +796,26 @@ "default": {}, "description": "ESLint is a static code analysis tool for JavaScript files." }, + "flake8": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": true, + "description": "Enable Flake8 | Flake8 is a Python linter that wraps PyFlakes, pycodestyle and Ned Batchelder's McCabe script. | v7.2.0" + } + }, + "additionalProperties": false, + "default": {}, + "description": "Flake8 is a Python linter that wraps PyFlakes, pycodestyle and Ned Batchelder's McCabe script." + }, "rubocop": { "type": "object", "properties": { "enabled": { "type": "boolean", "default": true, - "description": "Enable RuboCop | RuboCop is a Ruby static code analyzer (a.k.a. linter ) and code formatter. | v1.75.5" + "description": "Enable RuboCop | RuboCop is a Ruby static code analyzer (a.k.a. linter ) and code formatter. | v1.76.1" } }, "additionalProperties": false, @@ -686,7 +828,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable Buf | Buf offers linting for Protobuf files. | v1.54.0" + "description": "Enable Buf | Buf offers linting for Protobuf files. | v1.55.1" } }, "additionalProperties": false, @@ -699,7 +841,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable Regal | Regal is a linter and language server for Rego. | v0.33.1" + "description": "Enable Regal | Regal is a linter and language server for Rego. | v0.35.1" } }, "additionalProperties": false, @@ -725,7 +867,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable PMD | PMD is an extensible multilanguage static code analyzer. It’s mainly concerned with Java. | v7.13.0" + "description": "Enable PMD | PMD is an extensible multilanguage static code analyzer. It’s mainly concerned with Java. | v7.15.0" }, "config_file": { "type": "string", @@ -755,7 +897,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.122.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.128.1" }, "config_file": { "type": "string", @@ -772,20 +914,33 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable CircleCI | CircleCI tool is a static checker for CircleCI config files. | v0.1.31687" + "description": "Enable CircleCI | CircleCI tool is a static checker for CircleCI config files. | v0.1.32638" } }, "additionalProperties": false, "default": {}, "description": "CircleCI tool is a static checker for CircleCI config files." }, + "clippy": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": true, + "description": "Enable Clippy | Clippy is a collection of lints to catch common mistakes and improve your Rust code. | Enable Clippy integration." + } + }, + "additionalProperties": false, + "default": {}, + "description": "Clippy is a collection of lints to catch common mistakes and improve your Rust code." + }, "sqlfluff": { "type": "object", "properties": { "enabled": { "type": "boolean", "default": true, - "description": "Enable SQLFluff | SQLFluff is an open source, dialect-flexible and configurable SQL linter. | v3.4.0" + "description": "Enable SQLFluff | SQLFluff is an open source, dialect-flexible and configurable SQL linter. | v3.4.1" } }, "additionalProperties": false, @@ -798,25 +953,38 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable Prisma Schema linting | Prisma Schema linting helps maintain consistent and error-free schema files | v0.10.1" + "description": "Enable Prisma Schema linting | Prisma Schema linting helps maintain consistent and error-free schema files | v0.10.2" } }, "additionalProperties": false, "default": {}, "description": "Configuration for Prisma Schema linting to ensure schema file quality" }, + "pylint": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": true, + "description": "Enable Pylint | Pylint is a Python static code analysis tool. | v3.3.7" + } + }, + "additionalProperties": false, + "default": {}, + "description": "Pylint is a Python static code analysis tool." + }, "oxc": { "type": "object", "properties": { "enabled": { "type": "boolean", "default": true, - "description": "Enable OXC | OXC is a JavaScript/TypeScript linter written in Rust. | v0.16.10" + "description": "Enable Oxlint | Oxlint is a JavaScript/TypeScript linter for OXC written in Rust. | v0.16.10" } }, "additionalProperties": false, "default": {}, - "description": "OXC is a JavaScript/TypeScript linter written in Rust." + "description": "Oxlint is a JavaScript/TypeScript linter for OXC written in Rust." }, "shopifyThemeCheck": { "type": "object", @@ -830,6 +998,71 @@ "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" + }, + "brakeman": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": true, + "description": "Enable Brakeman | Brakeman is a static analysis security vulnerability scanner for Ruby on Rails applications. | v7.0.2" + } + }, + "additionalProperties": false, + "default": {}, + "description": "Brakeman is a static analysis security vulnerability scanner for Ruby on Rails applications. | v7.0.2" + }, + "dotenvLint": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": true, + "description": "Enable dotenv-linter | dotenv-linter is a tool for checking and fixing .env files for problems and best practices | v3.3.0" + } + }, + "additionalProperties": false, + "default": {}, + "description": "dotenv-linter is a tool for checking and fixing .env files for problems and best practices" + }, + "htmlhint": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": true, + "description": "Enable HTMLHint | HTMLHint is a static code analysis tool for HTML files. | Enable HTMLHint integration. | v1.5.0" + } + }, + "additionalProperties": false, + "description": "HTMLHint is a static code analysis tool for HTML files.", + "default": {} + }, + "checkmake": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": true, + "description": "Enable checkmake | checkmake is a linter for Makefiles. | v0.2.2" + } + }, + "additionalProperties": false, + "default": {}, + "description": "checkmake is a linter for Makefiles." } }, "additionalProperties": false, @@ -906,6 +1139,27 @@ "additionalProperties": false, "default": {} }, + "code_guidelines": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": true, + "description": "Enabled | Enable CodeRabbit to enforce your organization's coding standards during reviews." + }, + "filePatterns": { + "type": "array", + "items": { + "type": "string" + }, + "default": [], + "description": "File Patterns | Specify files for your coding guideline documents in this section. CodeRabbit will scan these files to understand your team's standards and apply them during code reviews. Multiple files supported. File names are case-sensitive. Common files like: (**/.cursorrules, .github/copilot-instructions.md, **/CLAUDE.md, **/GEMINI.md, **/.cursor/rules/*, **/.windsurfrules, **/.clinerules/*, **/.rules/*, **/AGENT.md) are included by default." + } + }, + "additionalProperties": false, + "default": {}, + "description": "CodeRabbit will analyse and learn from your organization's code guidelines, which you can mention in the file patterns section. These guidelines will then be used to conduct thorough code reviews." + }, "learnings": { "type": "object", "properties": { @@ -1088,7 +1342,17 @@ "de-LU", "fr-FR", "bg-BG", - "bg" + "bg", + "he-IL", + "he", + "hi-IN", + "hi", + "vi-VN", + "vi", + "th-TH", + "th", + "bn-BD", + "bn" ], "default": "en-US", "description": "Set the language for docstrings by using the corresponding ISO language code." @@ -1120,6 +1384,37 @@ "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, diff --git a/tailwind.config.js b/tailwind.config.js index b24582d0..dd081f63 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -21,7 +21,7 @@ module.exports = { preflight: false, // disable Tailwind's reset }, content: ["./src/**/*.{js,jsx,ts,tsx}", "../docs/**/*.mdx"], // my markdown stuff is in ../docs, not /src - darkMode: ["class", '[data-theme="dark"]'], // hooks into docusaurus' dark mode settigns + darkMode: ["class", '[data-theme="dark"]'], // hooks into docusaurus' dark mode settings theme: { fontFamily: { figtree: ["Figtree", "sans-serif"], pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy