version: "2"

run:
  timeout: 10m
  build-tags:
    - integration

linters:
  default: none
  enable:
    - errcheck
    - govet
    - ineffassign
    - staticcheck
    - unused
    - bodyclose
    - copyloopvar
    - dupword
    - durationcheck
    - errorlint
    - exhaustive
    - forbidigo
    - gocheckcompilerdirectives
    - gochecksumtype
    - goconst
    - gocritic
    - gocyclo
    - gosec
    - misspell
    - nilerr
    - nilnil
    - noctx
    - nolintlint
    - prealloc
    - predeclared
    - reassign
    - revive
    - rowserrcheck
    - sqlclosecheck
    - tagalign
    - tparallel
    - unconvert
    - unparam
    - usestdlibvars
    - wastedassign
    - whitespace

  settings:
    gocyclo:
      min-complexity: 30
    goconst:
      min-len: 4
      min-occurrences: 5
    gosec:
      excludes:
        - G101
        - G115
        - G204
        - G304
        - G306
        - G401
        - G501
    govet:
      enable-all: true
      disable:
        - fieldalignment
        - shadow
    revive:
      rules:
        - name: blank-imports
        - name: context-as-argument
        - name: context-keys-type
        - name: dot-imports
        - name: error-return
        - name: error-strings
        - name: error-naming
        - name: increment-decrement
        - name: var-declaration
        - name: package-comments
          disabled: true
        - name: range
        - name: receiver-naming
        - name: time-naming
        - name: unexported-return
        - name: indent-error-flow
        - name: errorf
        - name: empty-block
        - name: superfluous-else
        - name: unused-parameter
          disabled: true
        - name: unreachable-code
        - name: redefines-builtin-id
    forbidigo:
      forbid:
        - pattern: ^fmt\.Print.*$
          msg: "use logger instead of fmt.Print*"

  exclusions:
    generated: lax
    rules:
      - path: _test\.go
        linters:
          - errcheck
          - gosec
          - goconst
          - gocyclo
          - forbidigo
          - noctx
          - unparam
      - path: main\.go
        linters:
          - forbidigo
      - path: cli/
        linters:
          - forbidigo
      - text: "weak cryptographic primitive"
        linters:
          - gosec

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

formatters:
  enable:
    - gofmt
    - goimports
