v2.14.0.
Files
golangci-lint will run on files with the following extensions:.gogo.mod
Configuration
boolean
default:true
Enable golangci-lint
string
Optional path to the golangci-lint configuration file relative to the repository. Useful when the configuration file is named differently than the default ‘.golangci.yml’, ‘.golangci.yaml’, ‘.golangci.toml’, ‘.golangci.json’.
- .coderabbit.yaml
- Web UI
.coderabbit.yaml
.golangci.yml.golangci.yaml.golangci.toml.golangci.json
What CodeRabbit runs
We run golangci-lint in a sandbox with JSON output and per-module scoping. No plugins or external binaries are loaded. When no repository config is found, CodeRabbit generates a profile-based configuration:- Chill enables
govet,staticcheck,bodyclose,sqlclosecheck,durationcheck,nilerr,rowserrcheck,makezero,noctx, andfatcontext. - Assertive includes the Chill linters and adds
errcheck,copyloopvar,spancheck,reassign,ineffassign,unused,gosec,unconvert,wastedassign,errchkjson,errorlint,forcetypeassert,misspell,predeclared,loggercheck,zerologlint,protogetter, andcontextcheck.
Security policy and restrictions
Before running golangci-lint, CodeRabbit inspects your configuration and skips the run if it contains any of these:- A plugin declaration, written in any form, such as dotted keys or YAML aliases
- A non-empty
linters-settingsentry for a linter outside CodeRabbit’s allowlist of built-in linters - A non-empty
linters.presetsor top-levelpresetsarray
depguard rule named plugins doesn’t cause a skip either, because it’s a rule name, not a plugin declaration.
CodeRabbit also validates the configuration version. If the version can’t be evaluated safely, CodeRabbit skips golangci-lint.
When we skip golangci-lint
CodeRabbit will skip running golangci-lint when:- The config declares plugins.
- The config contains advanced or unsafe options we can’t guarantee are safe.
- CodeRabbit cannot safely inspect the configuration for disallowed plugins.
- The config declares a major version newer than the installed golangci-lint major version.
- A changed Go file has no ancestor
go.mod. - golangci-lint is already running in GitHub Actions, GitLab CI, CircleCI, or Azure Pipelines.