# golangci-lint configuration # Tuned for PoC / hobby projects: catches real bugs without noise. # Docs: https://golangci-lint.run/usage/configuration/ run: timeout: 5m # Align with go.mod # go: '1.24' # Enable specific linters on top of the default set. # Default set: errcheck, gosimple, govet, ineffassign, staticcheck, unused linters: enable: - gofmt # enforce gofmt formatting - goimports # enforce import grouping (stdlib / external / internal) - misspell # catch common English spelling mistakes in comments - bodyclose # HTTP response body must be closed - noctx # HTTP requests should use context - nolintlint # prevent unexplained //nolint directives - gocritic # opinionated but practical style checks - gosec # security-oriented checks (CWE coverage) - prealloc # suggest pre-allocation for slices - unconvert # remove unnecessary type conversions - unparam # flag unused function parameters - whitespace # leading/trailing blank lines in blocks # Linters disabled by default that are too noisy for PoC work: # - godot (dot at end of every comment — very pedantic) # - wsl (whitespace linter — very strict) # - dupl (duplicate code detection — high false-positive rate) # - funlen (function length limits — impractical for exploratory code) # - gocyclo (cyclomatic complexity — add back when code matures) # - gomnd (magic number detection — too noisy early on) # - exhaustive (enum switch exhaustiveness — useful later) linters-settings: gofmt: simplify: true goimports: # Put local module imports in their own group (after stdlib and external). local-prefixes: github.com/your-org/go-template gocritic: disabled-checks: - ifElseChain # chains are often more readable in switch-less code - hugeParam # not always actionable gosec: excludes: - G104 # Errors unhandled — already covered by errcheck - G304 # File path from variable — common in config loading misspell: locale: US unparam: check-exported: false # exported API params are intentional issues: exclude-rules: # Don't flag test files for some linters. - path: _test\.go linters: - unparam - gocritic - gosec # Don't fail on generated files. - path: mock_.*\.go linters: - all - path: mocks/ linters: - all max-issues-per-linter: 50 max-same-issues: 5