Skip to content

Add linter documentation #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: Move linter documentation to tools folder
  • Loading branch information
hasit committed Jul 15, 2024
commit ba319c517cff8f5e05cb704f5e1a167612e0e19d
23 changes: 0 additions & 23 deletions docs/guides/linters/linters.md

This file was deleted.

File renamed without changes.
39 changes: 39 additions & 0 deletions docs/guides/tools/linters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: Tools
sidebar_label: Tools
description: Overview of CodeRabbit's supported linters and security analysis tools.
sidebar_position: 1
---

CodeRabbit supports various linters and security analysis tools to improve the code review process. The output of these tools is used to enhance the feedback provided by CodeRabbit, making it possible to provide 1-click fixes for common issues.

## Enabling/Disabling Tools

You can enable or disable tools by setting `reviews.tools.<linter>.enabled` in your project's `.coderabbit.yaml` file or setting the "Review → Tools → Linter → Enabled" field in CodeRabbit's settings page.

## Customizing Tools

CodeRabbit supports customizing the strictness of tools by setting `reviews.profile` in your project's `.coderabbit.yaml` file or setting the "Review → Profile" field in CodeRabbit's settings page. The following profiles are available:

- `Chill` - Yields less feedback, that may be considered lenient.
- `Assertive` - Yields more feedback, that may be considered nit-picky.

Apart from the overall profile, you can also configure each tool by providing a configuration file (specific to the tool) in your project. This would allow you to further customize the tool's behavior, by enabling/disabling specific rules, setting rule severity, etc.

## Checking Tool Output

When a tool is enabled, CodeRabbit will run it on your change request and attach the output under "Review details" comment in the change request. The output will be displayed in a structured format, with information on the file, line number, and the issue detected. For example:

```text
Ruff
fib.py
21-21: f-string without any placeholders

Remove extraneous f prefix

(F541)
```

## Supported Tools

- [Ruff](./ruff.md)
2 changes: 1 addition & 1 deletion docs/guides/linters/ruff.md → docs/guides/tools/ruff.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Ruff
sidebar_label: Ruff
description: Overview of CodeRabbit's supported linters and security analysis tools.
description: CodeRabbit's guide to Ruff.
sidebar_position: 1
---

Expand Down