diff --git a/docs/changelog.md b/docs/changelog.md index 7c455f3e..1218e4f9 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -5,6 +5,17 @@ description: The latest updates and changes to CodeRabbit. sidebar_position: 13 --- +## April 8, 2025 + +### New Static Analysis Tools + +We've expanded our static analysis capabilities with two new tools: + +- **OXC**: A high-performance JavaScript/TypeScript linter written in Rust. +- **Prisma Lint**: A dedicated linter for Prisma schema files to help enforce consistent conventions and best practices. + +Both tools can be configured through their respective config files or through CodeRabbit's settings page. See our [tools documentation](https://docs.coderabbit.ai/tools/tools) for more details. + ## April 1, 2025 ### Code Graph Analysis diff --git a/docs/guides/agent_chat.md b/docs/guides/agent_chat.md index 7c50d028..40847871 100644 --- a/docs/guides/agent_chat.md +++ b/docs/guides/agent_chat.md @@ -2,7 +2,7 @@ title: Chat and Agentic Chat sidebar_label: Chat and Agentic Chat description: Learn about CodeRabbit Pro's chat and agentic chat system -sidebar_position: 8 +sidebar_position: 3 --- # CodeRabbit Chat diff --git a/docs/guides/commands.md b/docs/guides/commands.md index 82cc44e0..a2a2f70b 100644 --- a/docs/guides/commands.md +++ b/docs/guides/commands.md @@ -1,3 +1,10 @@ +--- +title: Commands +sidebar_label: Commands +description: Learn how to control CodeRabbit using commands in pull request comments +sidebar_position: 1 +--- + # CodeRabbit Commands > 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. diff --git a/docs/guides/custom-reports.md b/docs/guides/custom-reports.md index 2efbab41..30655bfb 100644 --- a/docs/guides/custom-reports.md +++ b/docs/guides/custom-reports.md @@ -2,7 +2,7 @@ title: Custom Reports sidebar_label: Custom Reports description: Learn how to create custom reports with CodeRabbit Pro's flexible reporting system -sidebar_position: 7 +sidebar_position: 8 --- ```mdx-code-block diff --git a/docs/guides/issue-chat.md b/docs/guides/issue-chat.md index 5ce44be7..a555f2c0 100644 --- a/docs/guides/issue-chat.md +++ b/docs/guides/issue-chat.md @@ -2,7 +2,7 @@ title: Issue Chat sidebar_label: Issue Chat description: Learn how to use CodeRabbit's chat capabilities within issues -sidebar_position: 10 +sidebar_position: 4 --- ```mdx-code-block diff --git a/docs/guides/issue-creation.md b/docs/guides/issue-creation.md index f3e81f1d..7c461477 100644 --- a/docs/guides/issue-creation.md +++ b/docs/guides/issue-creation.md @@ -2,7 +2,7 @@ title: Issue Creation sidebar_label: Issue Creation description: Learn how to create issues directly through CodeRabbit -sidebar_position: 9 +sidebar_position: 5 --- ```mdx-code-block diff --git a/docs/guides/linked-issues.md b/docs/guides/linked-issues.md new file mode 100644 index 00000000..3528f0a9 --- /dev/null +++ b/docs/guides/linked-issues.md @@ -0,0 +1,175 @@ +--- +title: Linked Issues +sidebar_label: Linked Issues +description: Learn how to effectively use linked issues with CodeRabbit for better pull request assessments +sidebar_position: 6 +--- + +# Linked Issues + +CodeRabbit provides intelligent assessment of linked issues to validate whether pull requests properly address their requirements. This guide explains how to effectively use linked issues and write clear issue descriptions for optimal results. + +## Understanding Linked Issues + +A linked issue is one that is explicitly referenced in your pull request description using platform-specific syntax: + +- GitHub: `fixes #123`, `closes #123`, `resolves #123` +- GitLab: `closes #123`, `fixes #123`, or full URLs +- Jira/Linear: Full URLs to tickets + +When CodeRabbit detects linked issues, it analyzes them against your pull request changes to determine if the requirements are met: + +![Linked Issue Assessment Example](/img/guides/linked-issue.png) + +## Best Practices for Issue Writing + +### Issue Titles + +Create descriptive, technical titles that clearly state the goal: + +✅ Good Examples: + +- "Add PrismaLint integration to configuration flow" +- "Fix race condition in user authentication" +- "Implement caching for GraphQL queries" + +❌ Poor Examples: + +- "Fix bug" +- "Update code" +- "Improve performance" + +### Issue Descriptions + +Write comprehensive descriptions that provide clear technical context: + +1. **Problem Statement** + + - Clearly describe what needs to be changed + - Include technical details about affected components + - Reference specific files or functions if known + +2. **Expected Solution** + - Outline the desired implementation approach + - Include code examples or pseudo-code when relevant + - List specific acceptance criteria + +Example Description: + +```markdown +Problem: +The configuration system doesn't validate Prisma schema files before deployment, +leading to potential runtime errors. + +Solution: +Integrate PrismaLint into the configuration flow to: + +- Validate schema files during PR checks +- Enforce consistent naming conventions +- Prevent common Prisma anti-patterns + +Affected Components: + +- Configuration validation pipeline +- CI/CD workflow +- Schema validation logic + +Acceptance Criteria: + +- [ ] PrismaLint runs on all PR checks +- [ ] Failed validations block merging +- [ ] Clear error messages for schema issues +``` + +### Consistent Terminology + +Use consistent terminology between issues and pull requests: + +✅ Good: + +- Use the same technical terms consistently +- Reference components with their exact names +- Maintain consistent naming patterns + +❌ Poor: + +- Mixing different terms for the same component +- Using vague or non-technical language +- Inconsistent capitalization or formatting + +## Linking Issues Effectively + +### In Pull Requests + +1. **Direct References** + + ```markdown + Fixes #123 + Resolves organization/repo#456 + Closes https://github.com/org/repo/issues/789 + ``` + +2. **Multiple Issues** + + ```markdown + This PR addresses: + + - Fixes #123 + - Closes #456 + - Resolves https://jira.company.com/browse/PROJ-789 + ``` + +### Cross-References + +For better traceability: + +1. Add PR references in issue comments +2. Use complete URLs when linking external systems +3. Maintain bidirectional links between related issues + +## How CodeRabbit Assesses Linked Issues + +CodeRabbit evaluates linked issues by: + +1. Analyzing issue titles and descriptions +2. Comparing changes in the pull request +3. Validating if requirements are met +4. Providing an assessment with: + - ✅: If the objective has been addressed in the PR. The 'Explanation' column will be left blank. + - ❌: If the objective has not been addressed in the PR. Here a brief explanation is added to the 'Explanation' column. + - ❓: If it is unclear whether the objective has been addressed. Here a brief explanation is added to the 'Explanation' column. + +:::note +Only the issue title and description are considered in the assessment. Comments and discussion threads are not currently analyzed. +::: + +## Tips for Better Assessments + +1. **Be Specific** + + - Include clear, measurable objectives + - List specific technical requirements + - Reference affected code components + +2. **Provide Context** + + - Explain why changes are needed + - Document current behavior + - Describe expected outcomes + +3. **Use Technical Details** + + - Include file paths when known + - Reference specific functions or classes + - Mention relevant technologies + +4. **Keep It Focused** + - One main objective per issue + - Clear scope boundaries + - Specific acceptance criteria + +## Related Resources + +- [Review Instructions](./review-instructions.md) +- [Issue Chat](./issue-chat.md) +- [Issue Creation](./issue-creation.md) diff --git a/docs/guides/ondemand-reports.md b/docs/guides/ondemand-reports.md index bad251f7..471dc04c 100644 --- a/docs/guides/ondemand-reports.md +++ b/docs/guides/ondemand-reports.md @@ -2,7 +2,7 @@ title: On-demand Reports sidebar_label: On-demand Reports description: CodeRabbit offers a way to generate on-demand reports using a simple API request -sidebar_position: 8 +sidebar_position: 9 --- ```mdx-code-block diff --git a/docs/guides/review-instructions.md b/docs/guides/review-instructions.md index dfb8ff70..fd2b76e8 100644 --- a/docs/guides/review-instructions.md +++ b/docs/guides/review-instructions.md @@ -5,7 +5,7 @@ description: CodeRabbit offers various customization options to tailor the reviews to your specific requirements. Customizations can be made using one of the below options. -sidebar_position: 3 +sidebar_position: 2 --- The guide explains how to add custom review instructions for the entire project. diff --git a/docs/guides/scheduled-reports.md b/docs/guides/scheduled-reports.md index 04bb06e6..8c56b465 100644 --- a/docs/guides/scheduled-reports.md +++ b/docs/guides/scheduled-reports.md @@ -2,7 +2,7 @@ title: Scheduled Reports sidebar_label: Scheduled Reports description: Learn how to set up automated recurring reports with CodeRabbit Pro -sidebar_position: 6 +sidebar_position: 7 --- ```mdx-code-block diff --git a/docs/integrations/code-graph-analysis.md b/docs/integrations/code-graph-analysis.md new file mode 100644 index 00000000..dd0bd582 --- /dev/null +++ b/docs/integrations/code-graph-analysis.md @@ -0,0 +1,66 @@ +--- +title: Code Graph Analysis +description: Learn about CodeRabbit's intelligent graph-based code analysis. +sidebar_label: Code Graph Analysis +sidebar_position: 6 +--- + +# CodeRabbit Code Graph Analysis + +## What is Code Graph Analysis? + +Code Graph Analysis is an intelligent code analysis feature that enhances your code reviews by automatically mapping relationships between files in your codebase. By +understanding how your code connects and interacts, Code Graph provides concrete snippets of context that makes reviews more effective and insightful. + +## How Code Graph Analysis Enhances Your Reviews + +When reviewing code with CodeRabbit, Code Graph Analysis automatically: + +- **Maps symbol definitions and references** across your entire codebase +- **Analyzes commit history** to identify files that frequently change together +- **Builds relationship graphs** showing how different parts of your code connect +- **Enriches reviews with contextual information** about related code + +Code Graph Analysis is also available in the CodeRabbit Chat. CodeRabbit Chat will automatically analyze your codebase with it when the agent deems it necessary. + +## Key Features + +### Three Types of Contextual Information + +Code Graph Analysis adds three powerful layers of context to your reviews: + +1. **Definition Files**: Files containing definitions that are referenced in the current code +2. **Reference Files**: Files that reference symbols defined in the current code +3. **Related Files**: Files that appear related based on usage patterns and commit history + +### Language Support + +Code Graph Analysis works with: + +- Bash +- C +- C# +- C++ +- CSS +- Elixir +- Go +- Java +- JavaScript +- Kotlin +- Lua +- PHP +- Python +- Ruby +- Rust +- Scala +- Swift +- TSX +- TypeScript + +## Availability + +Code Graph Analysis is available on the Lite tier and above. + +--- + +Learn more about CodeRabbit's advanced features at [coderabbit.ai](https://coderabbit.ai) diff --git a/docs/tools/oxc.md b/docs/tools/oxc.md new file mode 100644 index 00000000..ac01dfe0 --- /dev/null +++ b/docs/tools/oxc.md @@ -0,0 +1,46 @@ +--- +title: OXC +sidebar_label: OXC +description: CodeRabbit's guide to OXC (Oxidation Compiler). +--- + +```mdx-code-block +import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx'; + + +``` + +[OXC](https://github.com/oxc-project/oxc) is a collection of high-performance JavaScript/TypeScript tools written in Rust, including a linter that is 50-100x faster than ESLint. + +## Files + +OXC will run on files with the following extensions: + +- `.js` +- `.jsx` +- `.ts` +- `.tsx` + +## Configuration + +OXC supports the following config files: + +- `oxlint.json` +- `.oxlintrc` +- `.oxlintrc.json` +- `oxlint.config.json` + +:::note + +OXC does not require configuration to run. If no OXC config file is found and Biome is enabled, CodeRabbit will use Biome instead as OXC functionality is included within Biome. If Biome is not enabled or an OXC config file is found, CodeRabbit will use the default OXC config. + +::: + +## Rule Configuration + +While OXC embraces convention over configuration, you can customize rules in your config file if needed. The config file should be in JSON format. See the [OXC documentation](https://oxc-project.github.io) for more details on available rules and configuration options. + +## Links + +- [OXC GitHub Repository](https://github.com/oxc-project/oxc) +- [OXC Website](https://oxc.rust-server.org) diff --git a/docs/tools/tools.md b/docs/tools/tools.md index a700825f..71651f3a 100644 --- a/docs/tools/tools.md +++ b/docs/tools/tools.md @@ -55,9 +55,9 @@ Remove extraneous f prefix | GitLab Pipelines | [Pipeline Remediation][Pipeline] | CI/CD Failure Remediation | | Go | [golangci-lint][golangci-lint] | Code Quality | | Helm | [Checkov][Checkov] | Code Security | -| Javascript | [Biome][Biome] | Code Quality | +| Javascript | [Biome][Biome], [OXC][OXC] | Code Quality | | JSON, JSONC | [Biome][Biome] | Code Quality | -| JSX | [Biome][Biome] | Code Quality | +| JSX | [Biome][Biome], [OXC][OXC] | Code Quality | | Kotlin | [detekt][detekt] | Code Quality | | Kubernetes | [Checkov][Checkov] | Code Security | | Markdown | [markdownlint][markdownlint], [LanguageTool][LanguageTool] | Code Quality, Grammar Checking | @@ -73,8 +73,8 @@ Remove extraneous f prefix | SQL | [SQLFluff][SQLFluff] | Code Quality | | Swift | [SwiftLint][SwiftLint] | Code Quality | | Terraform | [Checkov][Checkov] | Code Security | -| TSX | [Biome][Biome] | Code Quality | -| Typescript | [Biome][Biome] | Code Quality | +| TSX | [Biome][Biome], [OXC][OXC] | Code Quality | +| Typescript | [Biome][Biome], [OXC][OXC] | Code Quality | | YAML | [YAMLlint][YAMLlint] | Code Quality | | Prisma | [Prisma Lint][PrismaLint] | Code Quality | @@ -102,3 +102,4 @@ Remove extraneous f prefix [Semgrep]: ./semgrep.md [Pipeline]: ./pipeline-remediation.md [PrismaLint]: ./prisma-lint.md +[OXC]: ./oxc.md diff --git a/static/img/guides/linked-issue.png b/static/img/guides/linked-issue.png new file mode 100644 index 00000000..ba585890 Binary files /dev/null and b/static/img/guides/linked-issue.png differ