You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- document the use of v1
- document configuring parallel use of v1 and v2
linters for the same project for code review
and CI/Cd, respectively; OR suggest to disable
linting in code reviews to avoid a warning
- provide links to both v1 and v2 configuration
documentation
Copy file name to clipboardExpand all lines: docs/tools/golangci-lint.md
+23-2Lines changed: 23 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,26 @@ import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx';
12
12
13
13
[golangci-lint](https://golangci-lint.run/) is a fast Go linters runner.
14
14
15
+
## Supported Version
16
+
17
+
At this time, CodeRabbit uses v1.x of the `golangci-lint` tool.
18
+
19
+
If you have a `golangci-lint v2` configuration file in your project, you will see a warning in CodeRabbit reviews and CodeRabbit will not be able to use `golangci-lint` to inform review comments.
20
+
21
+
There are two ways to avoid this warning.
22
+
23
+
### 1. Parallel Support for v1 (code review) and v2 (CI/CD) Linting
24
+
25
+
This will allow v2 linting in CI/CD pipelines while also enabling CodeRabbit to use v1.x linting for review comments.
26
+
27
+
- Provide a golangci-lint `version: "1"` configuration file that will not be used by golangci-lint itself, e.g. `.coderabbit-golangci.yml`
28
+
29
+
- Set `reviews.tools.golangci-lint.config_file` to reference that file in a `.coderabbit.yaml` file
30
+
31
+
### 2. Disable golangci-lint in CodeRabbit
32
+
33
+
- Set `reviews.tools.golangci-lint.enabled` to false in a `.coderabbit.yaml` file in your project.
34
+
15
35
## Files
16
36
17
37
golangci-lint will run on files with the following extensions:
@@ -21,7 +41,7 @@ golangci-lint will run on files with the following extensions:
21
41
22
42
## Configuration
23
43
24
-
golangci-lint supports the following config files:
44
+
golangci-lint supports v1 configuration files as follows:
25
45
26
46
- 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.
27
47
-`.golangci.yml`
@@ -31,4 +51,5 @@ golangci-lint supports the following config files:
0 commit comments