Skip to content

Commit 455af2a

Browse files
committed
Add linter documentation
- Update sidebar positions in documentation guides
1 parent d8ffef8 commit 455af2a

File tree

7 files changed

+153
-5
lines changed

7 files changed

+153
-5
lines changed

docs/guides/commands.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_label: CodeRabbit Commands
44
description:
55
CodeRabbit offers various commands that can be invoked as PR comments to
66
control the review process.
7-
sidebar_position: 3
7+
sidebar_position: 4
88
---
99

1010
The following commands are available (invoked as PR comments):

docs/guides/delete-account.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Delete CodeRabbit Account
33
sidebar_label: Delete CodeRabbit Account
44
# description:
5-
sidebar_position: 3
5+
sidebar_position: 5
66
---
77

88
The guide explains how to delete your CodeRabbit account and all the data

docs/guides/linters/_category_.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
label: Linters
2+
position: 2
3+
collapsible: true
4+
collapsed: true

docs/guides/linters/linters.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: Linters
3+
sidebar_label: Linters
4+
description: Overview of CodeRabbit's supported linters and security analysis tools.
5+
sidebar_position: 1
6+
---
7+
8+
CodeRabbit supports various linters and security analysis tools to help you maintain code quality.
9+
10+
## Enabling/Disabling Linters
11+
12+
You can enable or disable linters by setting `reviews.tools.<linter>.enabled` in your project's `.coderabbit.yaml` file or setting the "Review → Tools → Linter" field in CodeRabbit's settings page.
13+
14+
## Customizing Linters
15+
16+
CodeRabbit supports customizing the strictness of linters 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:
17+
18+
- `Chill` - Yields less feedback, that may be considered lenient.
19+
- `Assertive` - Yields more feedback, that may be considered nit-picky.
20+
21+
## Linters
22+
23+
- [Ruff](./ruff.md)

docs/guides/linters/ruff.md

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
title: Ruff
3+
sidebar_label: Ruff
4+
description: Overview of CodeRabbit's supported linters and security analysis tools.
5+
sidebar_position: 1
6+
---
7+
8+
Ruff is a linter and code formatter for Python.
9+
10+
## Settings
11+
12+
Ruff supports the following config files:
13+
14+
- `pyproject.toml`
15+
- `ruff.toml`
16+
- `.ruff.toml`
17+
18+
CodeRabbit will use the following settings if no config file is found:
19+
20+
### Chill
21+
22+
```toml
23+
[lint]
24+
select = [
25+
# pycodestyle subset rules
26+
"E7",
27+
"E9",
28+
# Pyflakes
29+
"F",
30+
# flake8-bugbear
31+
"B",
32+
# flake8-simplify
33+
"SIM",
34+
# isort subset rules
35+
"I002",
36+
]
37+
[lint.per-file-ignores]
38+
"**/__init__.py" = ["E402"]
39+
"**/conftest.py" = ["E402"]
40+
```
41+
42+
### Assertive
43+
44+
```toml
45+
[lint]
46+
select = [
47+
# pycodestyle subset rules
48+
"E7",
49+
"E9",
50+
# Pyflakes
51+
"F",
52+
# flake8-bugbear
53+
"B",
54+
# flake8-simplify
55+
"SIM",
56+
# isort subset rules
57+
"I002",
58+
# pycodestyle subset rules
59+
"E4",
60+
"E101",
61+
# mccabe
62+
"C90",
63+
# flake8-annotations
64+
"ANN",
65+
# flake8-async
66+
"ASYNC",
67+
# flake8-trio
68+
"TRIO",
69+
# flake8-bandit
70+
"S",
71+
# flake8-blind-except
72+
"BLE",
73+
# flake8-boolean-trap
74+
"FBT",
75+
# flake8-commas
76+
"COM",
77+
# flake8-comprehensions
78+
"C4",
79+
# flake8-datetimez
80+
"DTZ",
81+
# flake8-debugger
82+
"T10",
83+
# flake8-django
84+
"DJ",
85+
# flake8-executable
86+
"EXE",
87+
# flake8-implicit-str-concat
88+
"ISC",
89+
# flake8-logging
90+
"LOG",
91+
# flake8-logging-format
92+
"G",
93+
# flake8-pie
94+
"PIE",
95+
# flake8-pytest-style
96+
"PT",
97+
# flake8-raise
98+
"RSE",
99+
# flake8-return
100+
"RET",
101+
# flake8-unused-arguments
102+
"ARG",
103+
# tryceratops
104+
"TRY",
105+
# flynt
106+
"FLY",
107+
# Ruff-specific rules
108+
"RUF",
109+
# pyupgrade
110+
"UP",
111+
]
112+
[lint.per-file-ignores]
113+
"**/__init__.py" = ["E402"]
114+
"**/conftest.py" = ["E402"]
115+
"**/*_test.py" = ["S101"]
116+
"**/test_*.py" = ["S101"]
117+
"**/{test,tests}/**/*.py" = ["S101"]
118+
```
119+
120+
Links:
121+
122+
- [Ruff](https://docs.astral.sh/ruff/configuration/)

docs/guides/ondemand-reports.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: On-demand Reports
33
sidebar_label: On-demand Reports (Beta)
44
description:
55
CodeRabbit offers a way to generate on-demand reports using a simple API request
6-
sidebar_position: 5
6+
sidebar_position: 6
77
---
88

99
```mdx-code-block
@@ -54,7 +54,6 @@ Sample output:
5454
]
5555
```
5656

57-
5857
:::info
5958

6059
If you get a 401 UNAUTHORIZED error, check if you're passing the right API key in the `x-coderabbitai-api-key` header

docs/guides/review-instructions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description:
55
CodeRabbit offers various customization options to tailor the reviews to your
66
specific requirements. Customizations can be made using one of the below
77
options.
8-
sidebar_position: 2
8+
sidebar_position: 3
99
---
1010

1111
The guide explains how to add custom review instructions for the entire project.

0 commit comments

Comments
 (0)