Files
golangci-lint will run on files with the following extensions:.gogo.mod
Configuration
golangci-lint is enabled by default. Enable or disable it with.coderabbit.yaml or the CodeRabbit web UI:
- .coderabbit.yaml
- Web UI
.coderabbit.yaml
config_file value with no default. The current sandbox runtime discovers these standard filenames in each Go module root:
.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
- Plugins are disallowed. If plugins are referenced in config, we skip.
- Advanced or unsafe options cause a skip: top-level plugins, non-empty
linters-settingsentries outside CodeRabbit’s allowlist of built-in linters, or non-empty preset bundles. - Config version is validated; an “unsafe” evaluation returns version
0and we fail-closed. - Blocked configurations include:
- Any
pluginsentries (in any form) - Non-empty
linters-settingsentries for linters outside the built-in allowlist - Non-empty
linters.presetsor top-levelpresetsarrays
- Any
When we skip golangci-lint
CodeRabbit will skip running golangci-lint when:- The config references plugins (in any form).
- 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.