Skip to content

Commit c901e57

Browse files
authored
Add linter documentation (#59)
* Add linter documentation - Update sidebar positions in documentation guides * docs: Move linter documentation to tools folder * Add more tools * Add LanguageTool documentation and configuration * Update Biome documentation and configuration * docs: Update linter documentation and configuration * chore: Update tools category label in _category_.yml * chore: Update tools category label and add new tools * docs: Fix typo in Biome linter documentation * chore: Add SwiftLint documentation and configuration * Add golangci-lint, PHPStan, and SwiftLint documentation and configuration * Add Yamllint documentation and configuration * Add Checkov and Gitleaks documentation and configuration
1 parent 244d8bd commit c901e57

18 files changed

+880
-5
lines changed

docs/guides/commands.md

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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/ondemand-reports.md

Lines changed: 1 addition & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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.

docs/guides/tools/_category_.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
label: Tools
2+
position: 2
3+
collapsible: true
4+
collapsed: true

docs/guides/tools/biome.md

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
---
2+
title: Biome
3+
sidebar_label: Biome
4+
description: CodeRabbit's guide to Biome.
5+
sidebar_position: 5
6+
---
7+
8+
[Biome](https://biomejs.dev/) is a linter for JavaScript, TypeScript, JSX, TSX, JSON, JSONC, CSS.
9+
10+
## Files
11+
12+
Biome will run on files with the following extensions:
13+
14+
- `.js`
15+
- `.ts`
16+
- `.cjs`
17+
- `.mjs`
18+
- `.d.cts`
19+
- `.d.mts`
20+
- `.jsx`
21+
- `.tsx`
22+
- `.json`
23+
- `.jsonc`
24+
- `.css`
25+
26+
## Configuration
27+
28+
Biome supports the following config files:
29+
30+
- `biome.jsonc`
31+
- `biome.json`
32+
33+
CodeRabbit will use the following settings based on the profile selected if no config file is found:
34+
35+
### Chill
36+
37+
```json
38+
{
39+
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
40+
"organizeImports": {
41+
"enabled": false
42+
},
43+
"formatter": {
44+
"enabled": false
45+
},
46+
"linter": {
47+
"enabled": true,
48+
"rules": {
49+
"all": false,
50+
"recommended": true,
51+
"a11y": {
52+
"recommended": false
53+
},
54+
"correctness": {
55+
"useExhaustiveDependencies": "off",
56+
"noInnerDeclarations": "off"
57+
},
58+
"style": {
59+
"recommended": false,
60+
"noArguments": "warn",
61+
"noCommaOperator": "warn",
62+
"noUselessElse": "warn",
63+
"useAsConstAssertion": "off",
64+
"useBlockStatements": "off",
65+
"useConsistentArrayType": "off",
66+
"useDefaultParameterLast": "warn",
67+
"useEnumInitializers": "off",
68+
"useExponentiationOperator": "warn",
69+
"useExportType": "off",
70+
"useFragmentSyntax": "off",
71+
"useImportType": "off",
72+
"useLiteralEnumMembers": "warn",
73+
"useShorthandArrayType": "off",
74+
"noUnusedTemplateLiteral": "off"
75+
},
76+
"complexity": {
77+
"noForEach": "off",
78+
"noExcessiveCognitiveComplexity": {
79+
"level": "off",
80+
"options": {
81+
"maxAllowedComplexity": 25
82+
}
83+
},
84+
"useLiteralKeys": "off",
85+
"useArrowFunction": "off",
86+
"useFlatMap": "off"
87+
},
88+
"suspicious": {
89+
"noArrayIndexKey": "off",
90+
"noExplicitAny": "off",
91+
"noImplicitAnyLet": "off",
92+
"noDoubleEquals": "off"
93+
},
94+
"nursery": {
95+
"all": false
96+
}
97+
}
98+
},
99+
"css": {
100+
"linter": {
101+
"enabled": true
102+
},
103+
"parser": {
104+
"cssModules": true
105+
}
106+
},
107+
"javascript": {
108+
"parser": {
109+
"unsafeParameterDecoratorsEnabled": true
110+
}
111+
}
112+
}
113+
```
114+
115+
### Assertive
116+
117+
```json
118+
{
119+
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
120+
"organizeImports": {
121+
"enabled": false
122+
},
123+
"formatter": {
124+
"enabled": false
125+
},
126+
"linter": {
127+
"enabled": true,
128+
"rules": {
129+
"all": false,
130+
"recommended": true,
131+
"a11y": {
132+
"recommended": ""
133+
},
134+
"correctness": {
135+
"useExhaustiveDependencies": "off",
136+
"noInnerDeclarations": "warn"
137+
},
138+
"style": {
139+
"recommended": true,
140+
"noArguments": "warn",
141+
"noCommaOperator": "warn",
142+
"noUselessElse": "warn",
143+
"useAsConstAssertion": "off",
144+
"useBlockStatements": "off",
145+
"useConsistentArrayType": "off",
146+
"useDefaultParameterLast": "warn",
147+
"useEnumInitializers": "off",
148+
"useExponentiationOperator": "warn",
149+
"useExportType": "off",
150+
"useFragmentSyntax": "off",
151+
"useImportType": "off",
152+
"useLiteralEnumMembers": "warn",
153+
"useShorthandArrayType": "off",
154+
"noUnusedTemplateLiteral": "off"
155+
},
156+
"complexity": {
157+
"noForEach": "off",
158+
"noExcessiveCognitiveComplexity": {
159+
"level": "warn",
160+
"options": {
161+
"maxAllowedComplexity": 25
162+
}
163+
},
164+
"useLiteralKeys": "off",
165+
"useArrowFunction": "",
166+
"useFlatMap": ""
167+
},
168+
"suspicious": {
169+
"noArrayIndexKey": "",
170+
"noExplicitAny": "",
171+
"noImplicitAnyLet": "",
172+
"noDoubleEquals": ""
173+
},
174+
"nursery": {
175+
"all": false
176+
}
177+
}
178+
},
179+
"css": {
180+
"linter": {
181+
"enabled": true
182+
},
183+
"parser": {
184+
"cssModules": true
185+
}
186+
},
187+
"javascript": {
188+
"parser": {
189+
"unsafeParameterDecoratorsEnabled": true
190+
}
191+
}
192+
}
193+
194+
```
195+
196+
## Links
197+
198+
- [Biome Configuration](https://biomejs.dev/reference/configuration/)

docs/guides/tools/checkov.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: Checkov
3+
sidebar_label: Checkov
4+
description: CodeRabbit's guide to Checkov.
5+
sidebar_position: 2
6+
---
7+
8+
[Checkov](https://www.checkov.io/) is a static code analysis tool for scanning Infrastructure as Code (IaC) files for misconfigurations.
9+
10+
## Files
11+
12+
Checkov will run on files with the following files and extensions:
13+
14+
- `.tf`
15+
- `.yml`
16+
- `.yaml`
17+
- `.json`
18+
- `.template`
19+
- `.bicep`
20+
- `.hcl`
21+
- `bower.json`
22+
- `build.gradle`
23+
- `build.gradle.kts`
24+
- `go.sum`
25+
- `gradle.properties`
26+
- `METADATA`
27+
- `npm-shrinkwrap.json`
28+
- `package.json`
29+
- `package-lock.json`
30+
- `pom.xml`
31+
- `requirements.txt`
32+
- `Dockerfile`
33+
- `.dockerfile`
34+
- `Dockerfile.*`
35+
- `.csproj`
36+
- `yarn.lock`
37+
- `Gemfile`
38+
- `Gemfile.lock`
39+
- `go.mod`
40+
- `paket.dependencies`
41+
- `paket.lock`
42+
- `packages.config`
43+
- `composer.json`
44+
- `composer.lock`
45+
46+
## Configuration
47+
48+
CodeRabbit will include on the following severity levels based on the profile selected:
49+
50+
### Chill
51+
52+
- `HIGH`
53+
- `CRITICAL`
54+
55+
### Assertive
56+
57+
- `MEDIUM`
58+
- `HIGH`
59+
- `CRITICAL`
60+
61+
## Links
62+
63+
- [Checkov All Resource Scans](https://www.checkov.io/5.Policy%20Index/all.html)

docs/guides/tools/gitleaks.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: Gitleaks
3+
sidebar_label: Gitleaks
4+
description: CodeRabbit's guide to Gitleaks.
5+
sidebar_position: 11
6+
---
7+
8+
[Gitleaks](https://gitleaks.io/) is a secret-scanner.
9+
10+
## Files
11+
12+
Gitleaks will run on all files with the following extensions.
13+
14+
## Configuration
15+
16+
Gitleaks supports the following config files:
17+
18+
- `gitleaks.toml`
19+
20+
## Links
21+
22+
- [Gitleaks Configuration](https://github.com/gitleaks/gitleaks#configuration)

docs/guides/tools/golangci-lint.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: golangci-lint
3+
sidebar_label: golangci-lint
4+
description: CodeRabbit's guide to golangci-lint.
5+
sidebar_position: 9
6+
---
7+
8+
[golangci-lint](https://golangci-lint.run/) is a fast Go linters runner.
9+
10+
## Files
11+
12+
golangci-lint will run on files with the following extensions:
13+
14+
- `.go`
15+
- `go.mod`
16+
17+
## Configuration
18+
19+
golangci-lint supports the following config files:
20+
21+
- User-defined config file set at `reviews.tools.golangci-lint.config_file` in your project's `.coderabbit.yaml` file or setting the "Review → Tools → golangci-lint → Config File" field in CodeRabbit's settings page.
22+
- `.golangci.yml`
23+
- `.golangci.yaml`
24+
- `.golangci.toml`
25+
- `.golangci.json`
26+
27+
## Links
28+
29+
- [golangci-lint Configuration](https://golangci-lint.run/usage/configuration/)

0 commit comments

Comments
 (0)
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