version: "2"

run:
  timeout: 5m
  tests: true
  modules-download-mode: readonly

linters:
  enable:
    - govet
    - staticcheck
    - errcheck
    - ineffassign
    - unused
    - gosec
    - bodyclose
    - noctx
    - sqlclosecheck
    - revive
    - gocritic
    - unparam
    - wastedassign
    - durationcheck
    - goprintffuncname
    - goconst
    - misspell
    - copyloopvar
    - nilerr
  settings:
    revive:
      confidence: 0.8
      severity: warning
      rules:
        - name: indent-error-flow
        - name: early-return
        - name: error-naming
        - name: var-naming
        - name: if-return
        - name: context-as-argument
        - name: errorf
        - name: unexported-return
        - name: unnecessary-stmt
        - name: unreachable-code

    gocritic:
      disabled-checks:
        - ifElseChain
      settings:
        captLocal:
          paramsOnly: false

    gosec:
      excludes:
        - G204
        - G601

    errcheck:
      check-type-assertions: true

    staticcheck:
      checks: ["all", "-SA1019", "-ST1000", "-ST1020"]

    goconst:
      min-len: 3
      min-occurrences: 2

  exclusions:
    paths:
      - vendor
      - tmp
      - dist
    rules:
      - path: ".*_test\\.go"
        linters:
          - gosec
      - path: "mock/|mocks/"
        linters:
          - gosec
          - revive
          - errcheck

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

output:
  formats:
    text:
      path: stdout
      colors: true
