version: "2"

formatters:
  enable:
    - gofumpt

linters:
  enable:
    # - copyloopvar   # Detects places where loop variables are copied. TODO enable for Go 1.22+
    - dupword       # Detects duplicate words.
    - errorlint     # Detects code that may cause problems with Go 1.13 error wrapping.
    - gocritic      # Metalinter; detects bugs, performance, and styling issues.
    - gosec         # Detects security problems.
    - misspell      # Detects commonly misspelled English words in comments.
    - nilerr        # Detects code that returns nil even if it checks that the error is not nil.
    - nolintlint    # Detects ill-formed or insufficient nolint directives.
    - prealloc      # Detects slice declarations that could potentially be pre-allocated.
    - predeclared   # Detects code that shadows one of Go's predeclared identifiers
    - revive        # Metalinter; drop-in replacement for golint.
    - thelper       # Detects test helpers without t.Helper().
    - tparallel     # Detects inappropriate usage of t.Parallel().
    - unconvert     # Detects unnecessary type conversions.
    - usetesting    # Reports uses of functions with replacement inside the testing package.
  settings:
    govet:
      enable-all: true
      settings:
        shadow:
          strict: true
  exclusions:
    generated: strict
    presets:
      - comments
      - common-false-positives
      - legacy
      - std-error-handling
    rules:
      - linters:
          - govet
        text: '^shadow: declaration of "err" shadows declaration'

issues:
  max-issues-per-linter: 0
  max-same-issues: 0
