Skip to main content
golangci-lint is a fast Go linters runner. CodeRabbit runs golangci-lint v2.14.0.

Files

golangci-lint will run on files with the following extensions:
  • .go
  • go.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
CodeRabbit 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, and fatcontext.
  • Assertive includes the Chill linters and adds errcheck, copyloopvar, spancheck, reassign, ineffassign, unused, gosec, unconvert, wastedassign, errchkjson, errorlint, forcetypeassert, misspell, predeclared, loggercheck, zerologlint, protogetter, and contextcheck.

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-settings entry for a linter outside CodeRabbit’s allowlist of built-in linters
  • A non-empty linters.presets or top-level presets array
CodeRabbit reads the parsed configuration, not its raw text, so mentioning plugins in a comment or in an ordinary string value doesn’t cause a skip. A 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.