From 4282b9c8110df295dbf681201dba9446fb3dc88e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 06:37:52 +0000 Subject: [PATCH 1/9] Update schema.v2.json --- static/schema/schema.v2.json | 78 ++++++++---------------------------- 1 file changed, 17 insertions(+), 61 deletions(-) diff --git a/static/schema/schema.v2.json b/static/schema/schema.v2.json index 8dba06ac..198014dd 100644 --- a/static/schema/schema.v2.json +++ b/static/schema/schema.v2.json @@ -346,19 +346,6 @@ "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, @@ -402,7 +389,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.31.1" }, "shellcheck": { "type": "object", @@ -423,7 +410,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.8.2" } }, "additionalProperties": false, @@ -568,7 +555,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.0.3" }, "level": { "type": "string", @@ -617,7 +604,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable YAMLlint | YAMLlint is a linter for YAML files. | Enable YAMLlint integration. | v1.37.1" + "description": "Enable YAMLlint | YAMLlint is a linter for YAML files. | Enable YAMLlint integration. | v1.35.1" } }, "additionalProperties": false, @@ -630,7 +617,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.21.2" } }, "additionalProperties": false, @@ -656,7 +643,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable detekt | detekt is a static code analysis tool for Kotlin files. | v1.23.8" + "description": "Enable detekt | detekt is a static code analysis tool for Kotlin files. | v1.23.7" }, "config_file": { "type": "string", @@ -686,7 +673,7 @@ "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.73" } }, "additionalProperties": false, @@ -699,7 +686,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.47.2" } }, "additionalProperties": false, @@ -712,7 +699,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.29.2" } }, "additionalProperties": false, @@ -725,7 +712,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable actionlint | is a static checker for GitHub Actions workflow files. | v1.7.7" + "description": "Enable actionlint | is a static checker for GitHub Actions workflow files. | v1.7.4" } }, "additionalProperties": false, @@ -738,7 +725,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.8.0" }, "config_file": { "type": "string", @@ -755,7 +742,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable Cppcheck | Cppcheck is a static code analysis tool for the C and C++ programming languages. | v2.17.1" + "description": "Enable Cppcheck | Cppcheck is a static code analysis tool for the C and C++ programming languages. | v2.10-2" } }, "additionalProperties": false, @@ -768,7 +755,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.99.0" }, "config_file": { "type": "string", @@ -785,7 +772,7 @@ "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.31151" } }, "additionalProperties": false, @@ -798,7 +785,7 @@ "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.3.0" } }, "additionalProperties": false, @@ -811,7 +798,7 @@ "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.0" } }, "additionalProperties": false, @@ -824,7 +811,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable OXC | OXC is a JavaScript/TypeScript linter written in Rust. | v0.16.10" + "description": "Enable OXC | OXC is a JavaScript/TypeScript linter written in Rust. | v0.16.5" } }, "additionalProperties": false, @@ -1133,37 +1120,6 @@ "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, From 81a641c19e019ea9ed7ea0f81df785a659704c2d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 08:13:30 +0000 Subject: [PATCH 2/9] Update schema.v2.json --- static/schema/schema.v2.json | 78 ++++++++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 17 deletions(-) diff --git a/static/schema/schema.v2.json b/static/schema/schema.v2.json index 198014dd..8dba06ac 100644 --- a/static/schema/schema.v2.json +++ b/static/schema/schema.v2.json @@ -346,6 +346,19 @@ "additionalProperties": false, "default": {}, "description": "Docstrings | Options for generating Docstrings for your PRs/MRs." + }, + "unit_tests": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": true, + "description": "Unit Tests | Allow CodeRabbit to generate unit tests for PRs/MRs." + } + }, + "additionalProperties": false, + "default": {}, + "description": "Unit Tests | Options for generating unit tests for your PRs/MRs." } }, "additionalProperties": false, @@ -389,7 +402,7 @@ }, "additionalProperties": false, "default": {}, - "description": "Enable ast-grep | ast-grep is a code analysis tool that helps you to find patterns in your codebase using abstract syntax trees patterns. | v0.31.1" + "description": "Enable ast-grep | ast-grep is a code analysis tool that helps you to find patterns in your codebase using abstract syntax trees patterns. | v0.38.1" }, "shellcheck": { "type": "object", @@ -410,7 +423,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable Ruff | Ruff is a Python linter and code formatter. | Enable Ruff integration. | v0.8.2" + "description": "Enable Ruff | Ruff is a Python linter and code formatter. | Enable Ruff integration. | v0.11.9" } }, "additionalProperties": false, @@ -555,7 +568,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable PHPStan | PHPStan requires [config file](https://phpstan.org/config-reference#config-file) in your repository root. Please ensure that this file contains the `paths:` parameter. | v2.0.3" + "description": "Enable PHPStan | PHPStan requires [config file](https://phpstan.org/config-reference#config-file) in your repository root. Please ensure that this file contains the `paths:` parameter. | v2.1.15" }, "level": { "type": "string", @@ -604,7 +617,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable YAMLlint | YAMLlint is a linter for YAML files. | Enable YAMLlint integration. | v1.35.1" + "description": "Enable YAMLlint | YAMLlint is a linter for YAML files. | Enable YAMLlint integration. | v1.37.1" } }, "additionalProperties": false, @@ -617,7 +630,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable Gitleaks | Gitleaks is a secret scanner. | Enable Gitleaks integration. | v8.21.2" + "description": "Enable Gitleaks | Gitleaks is a secret scanner. | Enable Gitleaks integration. | v8.26.0" } }, "additionalProperties": false, @@ -643,7 +656,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable detekt | detekt is a static code analysis tool for Kotlin files. | v1.23.7" + "description": "Enable detekt | detekt is a static code analysis tool for Kotlin files. | v1.23.8" }, "config_file": { "type": "string", @@ -673,7 +686,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable RuboCop | RuboCop is a Ruby static code analyzer (a.k.a. linter ) and code formatter. | v1.73" + "description": "Enable RuboCop | RuboCop is a Ruby static code analyzer (a.k.a. linter ) and code formatter. | v1.75.5" } }, "additionalProperties": false, @@ -686,7 +699,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable Buf | Buf offers linting for Protobuf files. | v1.47.2" + "description": "Enable Buf | Buf offers linting for Protobuf files. | v1.54.0" } }, "additionalProperties": false, @@ -699,7 +712,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable Regal | Regal is a linter and language server for Rego. | v0.29.2" + "description": "Enable Regal | Regal is a linter and language server for Rego. | v0.33.1" } }, "additionalProperties": false, @@ -712,7 +725,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable actionlint | is a static checker for GitHub Actions workflow files. | v1.7.4" + "description": "Enable actionlint | is a static checker for GitHub Actions workflow files. | v1.7.7" } }, "additionalProperties": false, @@ -725,7 +738,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable PMD | PMD is an extensible multilanguage static code analyzer. It’s mainly concerned with Java. | v7.8.0" + "description": "Enable PMD | PMD is an extensible multilanguage static code analyzer. It’s mainly concerned with Java. | v7.13.0" }, "config_file": { "type": "string", @@ -742,7 +755,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable Cppcheck | Cppcheck is a static code analysis tool for the C and C++ programming languages. | v2.10-2" + "description": "Enable Cppcheck | Cppcheck is a static code analysis tool for the C and C++ programming languages. | v2.17.1" } }, "additionalProperties": false, @@ -755,7 +768,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable Semgrep | Semgrep is a static analysis tool designed to scan code for security vulnerabilities and code quality issues. | Enable Semgrep integration. | v1.99.0" + "description": "Enable Semgrep | Semgrep is a static analysis tool designed to scan code for security vulnerabilities and code quality issues. | Enable Semgrep integration. | v1.122.0" }, "config_file": { "type": "string", @@ -772,7 +785,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable CircleCI | CircleCI tool is a static checker for CircleCI config files. | v0.1.31151" + "description": "Enable CircleCI | CircleCI tool is a static checker for CircleCI config files. | v0.1.31687" } }, "additionalProperties": false, @@ -785,7 +798,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable SQLFluff | SQLFluff is an open source, dialect-flexible and configurable SQL linter. | v3.3.0" + "description": "Enable SQLFluff | SQLFluff is an open source, dialect-flexible and configurable SQL linter. | v3.4.0" } }, "additionalProperties": false, @@ -798,7 +811,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable Prisma Schema linting | Prisma Schema linting helps maintain consistent and error-free schema files | v0.10.0" + "description": "Enable Prisma Schema linting | Prisma Schema linting helps maintain consistent and error-free schema files | v0.10.1" } }, "additionalProperties": false, @@ -811,7 +824,7 @@ "enabled": { "type": "boolean", "default": true, - "description": "Enable OXC | OXC is a JavaScript/TypeScript linter written in Rust. | v0.16.5" + "description": "Enable OXC | OXC is a JavaScript/TypeScript linter written in Rust. | v0.16.10" } }, "additionalProperties": false, @@ -1120,6 +1133,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, From 7042a8ad2faf2d0933c4278fb524058546a60237 Mon Sep 17 00:00:00 2001 From: Jason McIntosh Date: Mon, 19 May 2025 14:47:32 -0400 Subject: [PATCH 3/9] Split the tools page into explainer and reference pages (#325) Split the tools page into seaprate explainer and references pages. Fixes #305. --- docs/tools/list.md | 74 +++++++++++++++++++++++++++++++++++++++++++++ docs/tools/tools.md | 70 +++--------------------------------------- sidebars.ts | 1 + 3 files changed, 80 insertions(+), 65 deletions(-) create mode 100644 docs/tools/list.md diff --git a/docs/tools/list.md b/docs/tools/list.md new file mode 100644 index 00000000..65f9d12d --- /dev/null +++ b/docs/tools/list.md @@ -0,0 +1,74 @@ +--- +title: List of supported tools +description: Overview of CodeRabbit's supported linters and security analysis tools +--- + +This is a list of the third-party open-source linters and security analysis tools that CodeRabbit uses to generate code reviews. + +For more information about fine-tuning the CodeRabbit configuration of a tool, click that tool's name in the following list. + +For an overview of how CodeRabbit uses these tools when generating code reviews, as well as general information about controlling their use, see [Configure third-party tools](/tools/). + +| Technology | Tools | Category | +| :-------------------------- | :--------------------------------------------------------- | :-------------------------------------------------- | +| All | [Gitleaks][Gitleaks], [Pipeline Remediation][Pipeline] | Code Security, CI/CD | +| Azure DevOps Pipelines | [Pipeline Remediation][Pipeline] | CI/CD Failure Remediation | +| CircleCI | [CircleCI][CircleCI], [Pipeline Remediation][Pipeline] | Configuration Validation, CI/CD Failure Remediation | +| CloudFormation | [Checkov][Checkov] | Code Security | +| Cppcheck | [Cppcheck][Cppcheck] | Code Quality | +| CSS | [Biome][Biome] | Code Quality | +| Docker | [Hadolint][Hadolint], [Checkov][Checkov] | Code Quality, Code Security | +| GitHub Actions | [actionlint][actionlint], [Pipeline Remediation][Pipeline] | Code Quality, CI/CD Failure Remediation | +| GitLab Pipelines | [Pipeline Remediation][Pipeline] | CI/CD Failure Remediation | +| Go | [golangci-lint][golangci-lint] | Code Quality | +| Helm | [Checkov][Checkov] | Code Security | +| Javascript | [Biome][Biome], [oxlint][oxlint] | Code Quality | +| JSON, JSONC | [Biome][Biome] | Code Quality | +| JSX | [Biome][Biome], [oxlint][oxlint] | Code Quality | +| Kotlin | [detekt][detekt] | Code Quality | +| Kubernetes | [Checkov][Checkov] | Code Security | +| Markdown | [markdownlint][markdownlint], [LanguageTool][LanguageTool] | Code Quality, Grammar Checking | +| PHP | [PHPStan][PHPStan] | Code Quality | +| Plaintext | [LanguageTool][LanguageTool] | Grammar and Spell Checking | +| Java | [PMD][PMD] | Code Quality | +| Protobuf | [Buf][Buf] | Code Quality | +| Python | [Ruff][Ruff] | Code Quality | +| Regal | [Regal][Regal] | Code Quality | +| Ruby | [RuboCop][RuboCop] | Code Quality | +| Semgrep | [Semgrep][Semgrep] | Code Security | +| Shell (sh, bash, ksh, dash) | [ShellCheck][ShellCheck] | Code Quality | +| Shopify | [Shopify CLI][ShopifyCLI] | Code Quality | +| SQL | [SQLFluff][SQLFluff] | Code Quality | +| Swift | [SwiftLint][SwiftLint] | Code Quality | +| Terraform | [Checkov][Checkov] | Code Security | +| TSX | [Biome][Biome], [oxlint][oxlint] | Code Quality | +| Typescript | [Biome][Biome], [oxlint][oxlint] | Code Quality | +| YAML | [YAMLlint][YAMLlint] | Code Quality | +| Prisma | [Prisma Lint][PrismaLint] | Code Quality | + +[ShellCheck]: /tools/shellcheck.md +[SQLFluff]: /tools/sqlfluff.md +[Ruff]: /tools/ruff.md +[markdownlint]: /tools/markdownlint.md +[LanguageTool]: /tools/languagetool.md +[Biome]: /tools/biome.md +[Hadolint]: /tools/hadolint.md +[SwiftLint]: /tools/swiftlint.md +[PHPStan]: /tools/phpstan.md +[golangci-lint]: /tools/golangci-lint.md +[YAMLlint]: /tools/yamllint.md +[Gitleaks]: /tools/gitleaks.md +[Checkov]: /tools/checkov.md +[detekt]: /tools/detekt.md +[RuboCop]: /tools/rubocop.md +[Buf]: /tools/buf.md +[actionlint]: /tools/actionlint.md +[Regal]: /tools/regal.md +[PMD]: /tools/pmd.md +[Cppcheck]: /tools/cppcheck.md +[CircleCI]: /tools/circleci.md +[Semgrep]: /tools/semgrep.md +[Pipeline]: /tools/pipeline-remediation.md +[PrismaLint]: /tools/prisma-lint.md +[oxlint]: /tools/oxlint.md +[ShopifyCLI]: /tools/shopify-cli.md 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 4e1e68d3..801435c8 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -145,6 +145,7 @@ const sidebars: SidebarsConfig = { label: "Supported tools", collapsed: true, items: [ + "tools/list", "tools/actionlint", "tools/biome", "tools/buf", From 7ca9e0b8906ea769de342fdc6b66d85a0fc05024 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 19:37:16 +0000 Subject: [PATCH 4/9] Update schema.v2.json --- static/schema/schema.v2.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/static/schema/schema.v2.json b/static/schema/schema.v2.json index 8dba06ac..66ccd0a5 100644 --- a/static/schema/schema.v2.json +++ b/static/schema/schema.v2.json @@ -843,6 +843,19 @@ "additionalProperties": false, "default": {}, "description": "Configuration for Shopify Theme Check to ensure theme quality and best practices" + }, + "luacheck": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": true, + "description": "Enable Lua code linting | Luacheck helps maintain consistent and error-free Lua code | v1.2.0" + } + }, + "additionalProperties": false, + "default": {}, + "description": "Configuration for Lua code linting to ensure code quality" } }, "additionalProperties": false, From b0fdbf04656a7017d5519ce76b9b397bbbd9f64f Mon Sep 17 00:00:00 2001 From: alexcoderabbitai Date: Mon, 19 May 2025 16:36:58 -0400 Subject: [PATCH 5/9] Feat/luacheck (#349) * adding luacheck * update changelog * enhanced * add sidebar --- docs/changelog.md | 6 ++++++ docs/tools/list.md | 2 ++ docs/tools/luacheck.md | 49 ++++++++++++++++++++++++++++++++++++++++++ sidebars.ts | 1 + 4 files changed, 58 insertions(+) create mode 100644 docs/tools/luacheck.md diff --git a/docs/changelog.md b/docs/changelog.md index 24e903ff..9fe3847d 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -5,6 +5,12 @@ description: The latest updates and changes to CodeRabbit. sidebar_position: 13 --- +## May 19, 2025 + +### Lua Support with Luacheck + +We're excited to announce enhanced support for Lua code analysis with [Luacheck](https://github.com/mpeterv/luacheck), a powerful static analyzer and linter for Lua code. + ## April 19, 2025 ### Docstring Path Instructions diff --git a/docs/tools/list.md b/docs/tools/list.md index 65f9d12d..d85b4c78 100644 --- a/docs/tools/list.md +++ b/docs/tools/list.md @@ -27,6 +27,7 @@ For an overview of how CodeRabbit uses these tools when generating code reviews, | JSX | [Biome][Biome], [oxlint][oxlint] | Code Quality | | Kotlin | [detekt][detekt] | Code Quality | | Kubernetes | [Checkov][Checkov] | Code Security | +| Lua | [Luacheck][Luacheck] | Code Quality | | Markdown | [markdownlint][markdownlint], [LanguageTool][LanguageTool] | Code Quality, Grammar Checking | | PHP | [PHPStan][PHPStan] | Code Quality | | Plaintext | [LanguageTool][LanguageTool] | Grammar and Spell Checking | @@ -72,3 +73,4 @@ For an overview of how CodeRabbit uses these tools when generating code reviews, [PrismaLint]: /tools/prisma-lint.md [oxlint]: /tools/oxlint.md [ShopifyCLI]: /tools/shopify-cli.md +[Luacheck]: /tools/luacheck.md diff --git a/docs/tools/luacheck.md b/docs/tools/luacheck.md new file mode 100644 index 00000000..3a8414b6 --- /dev/null +++ b/docs/tools/luacheck.md @@ -0,0 +1,49 @@ +--- +title: Luacheck +sidebar_label: Luacheck +description: CodeRabbit's guide to Luacheck. +--- + +```mdx-code-block +import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; + + +``` + +[Luacheck](https://github.com/mpeterv/luacheck) is a static analyzer and linter for Lua code that detects various issues such as undefined global variables, unused variables and values, accessing uninitialized variables, unreachable code, and more. + +## Supported Files + +Luacheck will run on files with the following extensions: + +- `.lua` + +## Configuration + +Luacheck supports the following configuration files: + +- `.luacheckrc` +- `luacheckrc` +- `.luacheckrc.lua` +- `luacheckrc.lua` + +:::note + +Luacheck does not require configuration to run. If no configuration file is found, it will use default settings. + +::: + +## Features + +Luacheck can detect: + +- Usage of undefined global variables +- Unused variables and values +- Accessing uninitialized variables +- Unreachable code +- And many more issues + +## Links + +- [Luacheck GitHub Repository](https://github.com/mpeterv/luacheck) +- [Luacheck Documentation](https://luacheck.readthedocs.io/) diff --git a/sidebars.ts b/sidebars.ts index 801435c8..c61517d4 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -158,6 +158,7 @@ const sidebars: SidebarsConfig = { "tools/golangci-lint", "tools/hadolint", "tools/languagetool", + "tools/luacheck", "tools/markdownlint", "tools/oxlint", "tools/phpstan", From b35301746f778b7dbf99022247cebcbce29e7820 Mon Sep 17 00:00:00 2001 From: nimratcoderabbit Date: Tue, 20 May 2025 10:26:11 -0400 Subject: [PATCH 6/9] UPDATE CHANGELOG FOR VS CODE (#352) Co-authored-by: Nimrat Kaur --- docs/changelog.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index 9fe3847d..6a21a8ab 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -11,6 +11,24 @@ sidebar_position: 13 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 From 57bdf564ff1c2af446ded9c5ae93b1c7df907431 Mon Sep 17 00:00:00 2001 From: Nick Busey Date: Tue, 20 May 2025 21:58:08 -0600 Subject: [PATCH 7/9] Add caching page (#353) --- docs/reference/caching.md | 20 ++++++++++++++++++++ sidebars.ts | 1 + 2 files changed, 21 insertions(+) create mode 100644 docs/reference/caching.md 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/sidebars.ts b/sidebars.ts index c61517d4..2668b5c1 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -175,6 +175,7 @@ const sidebars: SidebarsConfig = { "tools/yamllint", ], }, + "reference/caching", ], }, { From e2e308419dddcc575183abc92c05a5776765f0a1 Mon Sep 17 00:00:00 2001 From: Hasit Mistry Date: Wed, 21 May 2025 11:42:54 -0700 Subject: [PATCH 8/9] Update introduction.md to clarify Git platform integrations (#356) --- docs/overview/introduction.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From d01fee9c3e1e76497e382b75c4a8ae7d825c37c7 Mon Sep 17 00:00:00 2001 From: Jason McIntosh Date: Fri, 23 May 2025 17:51:56 -0400 Subject: [PATCH 9/9] Expand and refactor the code-review docs (#355) * Split the current chat commands page into three pages: a reference page, a troubleshooting guide, and a best practices guide. Replace the chat commands page with two task-orience how-to guides, one about controlling code reviews, and one about generating improvements. Add a new overview page for the code review process. --- docs/guides/code-review-best-practices.md | 42 +++++ docs/guides/code-review-overview.md | 89 ++++++++++ docs/guides/code-review-troubleshooting.md | 17 ++ docs/guides/commands.md | 180 ++++++++++++++------- docs/guides/generate-improvements.md | 102 ++++++++++++ docs/reference/review-commands.md | 47 ++++++ sidebars.ts | 5 + 7 files changed, 422 insertions(+), 60 deletions(-) create mode 100644 docs/guides/code-review-best-practices.md create mode 100644 docs/guides/code-review-overview.md create mode 100644 docs/guides/code-review-troubleshooting.md create mode 100644 docs/guides/generate-improvements.md create mode 100644 docs/reference/review-commands.md diff --git a/docs/guides/code-review-best-practices.md b/docs/guides/code-review-best-practices.md new file mode 100644 index 00000000..83bd8abb --- /dev/null +++ b/docs/guides/code-review-best-practices.md @@ -0,0 +1,42 @@ +--- +title: Code review best practices +description: Best practices for managing CodeRabbit code reviews. +sidebar_label: Best practices +--- + +This page lists best practices for performing code reviews with CodeRabbit. + +For more information about working with +CodeRabbit through chat, see [Control and manage code reviews](/guides/commands). + +For a CodeRabbit command reference, see [Code review command reference](/reference/review-commands). + +## Recommended code-review workflow + +- Start with `@coderabbitai review` for checking new changes. +- Use `@coderabbitai full review` when major changes require a fresh perspective. +- Generate summaries after significant updates using `@coderabbitai summary`. + +## Managing large changes + +- Use `@coderabbitai pause` before making multiple commits. +- Resume reviews with `@coderabbitai resume` when ready. +- Consider `@coderabbitai full review` after substantial changes. + +## Documentation flow + +- Run `@coderabbitai generate docstrings` after finalizing function implementations. +- Learn more about [docstring generation](/finishing-touches/docstrings). + +## Overall tips + +- Commands are case-insensitive (`@coderabbitai REVIEW` works the same as `@coderabbitai review`). +- Commands can be issued by anyone with write access to the repository. +- Multiple commands can be used in sequence as needed. +- Use `@coderabbitai configuration` to export your settings before making changes. + +## Command response time + +- Most commands (pause, resume, ignore) take effect immediately. +- Review commands typically complete within a few minutes, depending on PR size. +- Docstring generation time varies based on the number of functions. diff --git a/docs/guides/code-review-overview.md b/docs/guides/code-review-overview.md new file mode 100644 index 00000000..cd511c76 --- /dev/null +++ b/docs/guides/code-review-overview.md @@ -0,0 +1,89 @@ +--- +title: Review pull requests +description: An overview of CodeRabbit's core code review features. +sidebar_label: Overview +--- + +The central feature of CodeRabbit is its ability to proactively review +new pull requests on your code repository. + +CodeRabbit reviews take the form of pull request comments that +include summaries, analyses, and initial critiques of the proposed changes. +This information, usually added to pull requests within minutes, can help your team perform more rapid, better-informed code reviews. + +The following sections present an overview of this feature. For a hands-on example that lets you experience a CodeRabbit code review using +a real repository, see [Quickstart](/getting-started/quickstart). + +## Automatically review pull requests {#review} + +After you [integrate CodeRabbit with your repository](/platforms), CodeRabbit proceeds +to automatically review every subsequent pull request, as soon as each one is created. + +CodeRabbit performs code reviews by attaching comments to the pull request. +These comments contain detailed summaries and analyses of the changes, +as well as listing out problems or areas for potential improvement that it found. + +CodeRabbit uses [a variety of open-source linters and security tools](/tools) and a custom +code verification agent to provide this analysis. CodeRabbit +also consults several models to further analyze and critique the proposed changes, +using all of the content of your repository as context. The code-review comment that CodeRabbit attaches +to your pull request synthesizes and summarizes all of the information collected from these different sources. + +For more information about the graph analysis that CodeRabbit includes with its reviews +when available, see [CodeRabbit Code Graph Analysis](/integrations/code-graph-analysis). + +### Events that trigger automated reviews {#events} + +By default, the following activity in your repository triggers CodeRabbit to +perform a code review: + +- If CodeRabbit sees a new pull request, then it immediately performs a full review + of the proposed code changes. +- If an open pull request that CodeRabbit has already reviewed gets modified with another + commit, then CodeRabbit performs an incremental review that focuses on the new commit. + +## Interact with CodeRabbit reviews {#interact} + +After CodeRabbit attaches its initial code-review comment to a pull request, you can +directly interact with CodeRabbit by mentioning its username, `@coderabbitai`, in comments +that you post to the pull request. + +These interactions can serve several purposes: + +- Free-form discussion about the pull request and the ongoing code review. +- Commands to have CodeRabbit perform specific actions regarding the code review. +- Prompts to have CodeRabbit generate its own improvements to the branch under review. + +### Chat with CodeRabbit {#chat} + +You can have open-ended, natural-language discussion with CodeRabbit during a code review, treating it +as an LLM-powered chatbot that has your entire code repository available for context. For more information, see [CodeRabbit Chat](/guides/agent_chat). + +### Manage CodeRabbit review behavior {#manage} + +CodeRabbit recognizes a variety of keyword-based commands that let you control its +behavior during a code review, including the following: + +- Pause or resume automated reviews of the pull request. +- Manually request a review, when automated reviews are paused. +- Resolve all open comments authored by CodeRabbit. + +For more information, see [Control and manage code reviews](/guides/commands). + +### Generate improvements {#generate} + +You can command CodeRabbit to generate improvements to the branch under review. +CodeRabbit accomplishes this by publishing a new branch based on the branch under review, +and creating a new pull request for your own review. + +Available code-generation commands let you request the following from CodeRabbit: + +- Implement the suggestions for improvements that CodeRabbit has made in its earlier code review comments. +- Generate inline documentation for any undocumented functions that this pull request proposes to add. + +For more information, see [Generate improvements](/guides/generate-improvements). + +## What's next {#whats-next} + +- [Control and manage code reviews](/guides/commands) +- [Generate code improvements](/guides/generate-improvements) diff --git a/docs/guides/code-review-troubleshooting.md b/docs/guides/code-review-troubleshooting.md new file mode 100644 index 00000000..72539453 --- /dev/null +++ b/docs/guides/code-review-troubleshooting.md @@ -0,0 +1,17 @@ +--- +title: Code review troubleshooting +description: Troubleshooting CodeRabbit code reviews. +sidebar_label: Troubleshooting +--- + +This page is about troubleshooting interactive code review sessions with CodeRabbit. For more information about working with +CodeRabbit through chat, see [Control and manage code reviews](/guides/commands). + +If a CodeRabbit command doesn't seem to work: + +1. Check that you have the necessary repository permissions. +2. Verify the command syntax. +3. Look for any response from CodeRabbit in the PR comments. +4. Use `@coderabbitai help` for command guidance. + +Need help? Join our community on [Discord](https://discord.gg/coderabbit) or [contact our support team](/getting-started/support). diff --git a/docs/guides/commands.md b/docs/guides/commands.md index 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/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/reference/review-commands.md b/docs/reference/review-commands.md new file mode 100644 index 00000000..011bf9d5 --- /dev/null +++ b/docs/reference/review-commands.md @@ -0,0 +1,47 @@ +--- +title: Code review commands +description: A list of commands that you can issue to CodeRabbit during code reviews. +--- + +This page lists the various commands that you can issue to CodeRabbit through +its chat interface during code reviews. For more information about working with +CodeRabbit through chat, see [Interact with CodeRabbit reviews](/guides/code-review-overview#interact). + +| Command | Description | Use Case | +| --------------------------- | ---------------------------------------------------- | ---------------------------------------------------------------------------- | +| `@coderabbitai review` | Triggers an incremental review of new changes | When automatic reviews are disabled or you want to manually trigger a review | +| `@coderabbitai full review` | Performs a complete review of all files from scratch | When you want to get fresh insights on the entire PR | +| `@coderabbitai summary` | Regenerates the PR summary | When you want an updated overview after making changes | + +## Code review flow control + +| Command | Description | Use Case | +| ---------------------- | ---------------------------------------- | --------------------------------------------------- | +| `@coderabbitai pause` | Temporarily stops reviews on the PR | When you're making multiple rapid changes | +| `@coderabbitai resume` | Restarts reviews after a pause | When you're ready for CodeRabbit to review again | +| `@coderabbitai ignore` | Permanently disables reviews for this PR | When you want to handle the review process manually | + +## Comment management + +| Command | Description | Use Case | +| ----------------------- | --------------------------------------- | ------------------------------------------------------- | +| `@coderabbitai resolve` | Resolves all CodeRabbit review comments | When you've addressed all feedback and want to clean up | + +## Documentation commands + +| Command | Description | Use Case | +| ----------------------------------- | -------------------------------------------- | --------------------------------------------------- | +| `@coderabbitai generate docstrings` | Generates docstrings for functions in the PR | When you need automatic documentation for your code | +| `@coderabbitai configuration` | Shows current CodeRabbit settings | When you need to check or export your configuration | + +## Agentic chat commands + +| Command | Description | Use Case | +| -------------------- | ---------------------------------------------------------- | ---------------------------------------------------- | +| `@coderabbitai plan` | Get the agentic chat to plan an edit for previous comments | When you want CodeRabbit to change your code for you | + +## Help and support + +| Command | Description | Use Case | +| -------------------- | ------------------------------------------ | ------------------------------------------ | +| `@coderabbitai help` | Displays available commands and usage info | When you need guidance on using CodeRabbit | diff --git a/sidebars.ts b/sidebars.ts index 2668b5c1..210e385d 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -84,7 +84,11 @@ const sidebars: SidebarsConfig = { collapsed: true, label: "Review pull requests", items: [ + "guides/code-review-overview", "guides/commands", + "guides/generate-improvements", + "guides/code-review-best-practices", + "guides/code-review-troubleshooting", "guides/agent_chat", { type: "category", @@ -140,6 +144,7 @@ const sidebars: SidebarsConfig = { label: "CodeRabbit API", href: "https://api.coderabbit.ai/api/swagger/", }, + "reference/review-commands", { type: "category", label: "Supported tools",