Skip to content

Commit e5c1448

Browse files
Update golangci-lint.md
1 parent 0df5ad1 commit e5c1448

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

docs/tools/golangci-lint.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,42 @@ import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx';
1212

1313
[golangci-lint](https://golangci-lint.run/) is a fast Go linters runner.
1414

15+
16+
# golangci-lint
17+
1518
## Files
1619

17-
golangci-lint will run on files with the following extensions:
20+
`golangci-lint` is a fast Go linters runner. It is a code quality tool that aggregates many Go linters into a single tool.
21+
22+
## Supported Versions
23+
24+
CodeRabbit currently supports `golangci-lint` v1.x.
25+
26+
Users attempting to use `golangci-lint` v2.x may encounter warnings or unexpected behavior, as full compatibility with v2.x is not yet guaranteed. We recommend configuring your project to use `golangci-lint` v1.x if you experience issues.
27+
28+
## Configuration
29+
30+
`golangci-lint` supports the following configuration files:
31+
32+
- `.golangci.yml`
33+
- `.golangci.yaml`
34+
- `.golangci.toml`
35+
- `.golangci.json`
36+
37+
CodeRabbit will automatically detect and use these configuration files if present in your repository.
38+
39+
## Integrating v1 alongside v2 (Workaround)
40+
41+
If your project requires `golangci-lint` v2 for local development or CI, but you wish to use CodeRabbit for v1-compatible linting, you can manage this by:
42+
43+
1. **Ensuring a v1-compatible configuration file exists:** Create or maintain a `.golangci.yml` (or other supported format) that is compatible with `golangci-lint` v1.x.
44+
2. **Using a separate script for v2:** For your local development or CI, you might use a wrapper script or a different command to invoke `golangci-lint` v2, ensuring it uses a v2-specific configuration if needed. CodeRabbit will primarily look for the standard configuration files.
45+
46+
Alternatively, you can disable `golangci-lint` in CodeRabbit if v2 is strictly required and you cannot maintain a v1-compatible configuration.
47+
48+
## Features
1849

19-
- `.go`
20-
- `go.mod`
50+
`golangci-lint` can detect many issues such as:
2151

2252
## Configuration
2353

0 commit comments

Comments
 (0)