version: "2"
run:
  concurrency: 4
  relative-path-mode: gomod
linters:
  default: none
  enable:
    - asasalint
    - asciicheck
    - bodyclose
    - containedctx
    - copyloopvar
    - cyclop
    - dogsled
    - err113
    - errcheck
    - errname
    - errorlint
    - exptostd
    - forbidigo
    - gocheckcompilerdirectives
    - gochecknoinits
    - goconst
    - gocritic
    - gomoddirectives
    - goprintffuncname
    - gosec
    - govet
    - grouper
    - ineffassign
    - lll
    - misspell
    - nakedret
    - nilerr
    - nilnesserr
    - noctx
    - nolintlint
    - prealloc
    - predeclared
    - revive
    - staticcheck
    - unconvert
    - unparam
    - unused
    - usestdlibvars
    - usetesting
    - whitespace
  settings:
    cyclop:
      max-complexity: 15
    goconst:
      match-constant: false
    gocritic:
      disabled-checks:
        - commentFormatting
    gosec:
      config:
        G306: "0644"
    govet:
      disable:
        - fieldalignment
      enable-all: true
    lll:
      line-length: 160
    mnd:
      ignored-numbers:
        - "0644"
        - "0755"
    nolintlint:
      require-explanation: true
      require-specific: true
    staticcheck:
      checks:
        - -ST1000
        - -ST1003
        - -ST1020
        - -ST1021
        - -ST1022
        - all
    usestdlibvars:
      time-month: true
      time-layout: true
      crypto-hash: true
      default-rpc-path: true
      tls-signature-scheme: true
      constant-kind: true
    usetesting:
      os-temp-dir: true
    revive:
      rules:
        - name: var-naming
          arguments:
            - [] # AllowList
            - [] # DenyList
            - - skip-package-name-collision-with-go-std: true
  exclusions:
    generated: lax
    presets:
      - comments
      - common-false-positives
      - legacy
      - std-error-handling
    rules:
      - linters:
          - staticcheck
        text: 'SA1019:'
      - linters:
          - err113
        path-except: pkg\/
      - linters:
          - err113
          - errcheck
          - funlen
          - gocyclo
          - gosec
          - lll
          - mnd
          - prealloc
        path: _test\.go
      - linters:
          - goconst
        path: (.+)_test\.go
    paths:
      - .*\_gen\.go$
      - .*\.gen\.go$
      - .*\_gen\_test\.go$
      - .*\.gen\_test\.go$
      - .*\.pb\.go$
      - mock
      - vendor
      - testdata
      - test_data
      - third_party$
      - third-party$
      - builtin$
      - examples$
      - example$
issues:
  max-issues-per-linter: 0
  max-same-issues: 0
  uniq-by-line: false
formatters:
  exclusions:
    generated: lax
    paths:
      - third_party$
      - third-party$
      - builtin$
      - examples$
      - example$
