Skip to content

Linting

Linting

This project uses golangci-lint (v2) with 46+ linters enabled.

The linter is pinned as a Go tool dependency and invoked via go tool golangci-lint.

Commands

CommandDescription
make go-lintLint and auto-fix
make go-lint-checkLint check only (no fix)
make go-lint-fastFast linters only with auto-fix
make go-fmtFormat all Go files with gofumpt

Key Rules

  • Max line length: 200 characters
  • Max cyclomatic complexity: 16
  • Formatting: gofumpt (stricter than gofmt)

Git Hooks (lefthook)

HookCommandTrigger
pre-commitmake go-fmt*.go files staged
pre-pushmake go-lint*.go files pushed

Run make install-dev to set up hooks.