version: "2"
run:
  modules-download-mode: readonly
linters:
  enable:
    - asasalint
    - asciicheck
    - bidichk
    - bodyclose
    - canonicalheader
    - containedctx
    - contextcheck
    - copyloopvar
    - cyclop
    - decorder
    - depguard
    - dogsled
    - dupl
    - dupword
    - durationcheck
    - err113
    - errcheck
    - errchkjson
    - errname
    - errorlint
    - exhaustive
    - exhaustruct
    - exptostd
    - fatcontext
    - forbidigo
    - forcetypeassert
    - funcorder
    - funlen
    - ginkgolinter
    - gocheckcompilerdirectives
    - gochecknoglobals
    - gochecknoinits
    - gochecksumtype
    - gocognit
    - goconst
    - gocritic
    - gocyclo
    - godot
    - godox
    - goheader
    - gomoddirectives
    - gomodguard
    - goprintffuncname
    - gosec
    - gosmopolitan
    - govet
    - grouper
    - iface
    - importas
    - inamedparam
    - ineffassign
    - interfacebloat
    - intrange
    - ireturn
    - lll
    - loggercheck
    - maintidx
    - makezero
    - mirror
    - misspell
    - mnd
    - musttag
    - nakedret
    - nestif
    - nilerr
    - nilnesserr
    - nilnil
    - nlreturn
    - noctx
    - nolintlint
    - nonamedreturns
    - nosprintfhostport
    - paralleltest
    - perfsprint
    - prealloc
    - predeclared
    - promlinter
    - protogetter
    - reassign
    - recvcheck
    - revive
    - rowserrcheck
    - sloglint
    - spancheck
    - sqlclosecheck
    - staticcheck
    - tagalign
    - tagliatelle
    - testableexamples
    - testifylint
    - testpackage
    - thelper
    - tparallel
    - unconvert
    - unparam
    - unused
    - usestdlibvars
    - usetesting
    - varnamelen
    - wastedassign
    - whitespace
    - wrapcheck
    - wsl_v5
    - zerologlint
  disable:
    - paralleltest
  exclusions:
    generated: lax
    presets:
      - comments
      - common-false-positives
      - legacy
      - std-error-handling
    paths:
      - third_party$
      - builtin$
      - examples$
  settings:
    depguard:
      rules:
        prevent_unmaintained_packages:
          list-mode: lax # allow unless explicitely denied
          allow:
            - github.com/stretchr/testify/*
          deny:
            - pkg: io/ioutil
              desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil"
    exhaustruct:
      exclude:
        - '.+/typedef\.VirtualEntity$'
        - '.+/typedef\.FeatureForAttributes$'
        - '.+/typedef\.GetDataSourceRegistry$'
        - '.+/typedef\.SzConfigExportResponse$'
        - '.+/typedef\.SzConfigGetDataSourceRegistryResponse$'
        - '.+/typedef\.SzConfigManagerGetConfigRegistryResponse$'
        - '.+/typedef\.SzConfigRegisterDataSourceResponse$'
        - '.+/typedef\.SzDiagnosticCheckRepositoryPerformanceResponse$'
        - '.+/typedef\.SzDiagnosticGetFeatureResponse$'
        - '.+/typedef\.SzEngineDeleteRecordResponse$'
        - '.+/typedef\.SzEngineFindInterestingEntitiesByEntityIDResponse$'
        - '.+/typedef\.SzEngineFindInterestingEntitiesByRecordIDResponse$'
        - '.+/typedef\.SzEngineFindNetworkByEntityIDResponse$'
        - '.+/typedef\.SzEngineFindNetworkByRecordIDResponse$'
        - '.+/typedef\.SzEngineFindPathByEntityIDResponse$'
        - '.+/typedef\.SzEngineFindPathByRecordIDResponse$'
        - '.+/typedef\.SzEngineGetEntityByEntityIDResponse$'
        - '.+/typedef\.SzEngineGetEntityByRecordIDResponse$'
        - '.+/typedef\.SzEngineGetRecordResponse$'
        - '.+/typedef\.SzEngineGetRecordPreviewResponse$'
        - '.+/typedef\.SzEngineGetVirtualEntityByRecordIDResponse$'
        - '.+/typedef\.SzEngineHowEntityByEntityIDResponse$'
        - '.+/typedef\.SzEngineGetRedoRecordResponse$'
        - '.+/typedef\.SzEngineProcessRedoRecordResponse$'
        - '.+/typedef\.SzEngineReevaluateEntityResponse$'
        - '.+/typedef\.SzEngineReevaluateRecordResponse$'
        - '.+/typedef\.SzEngineSearchByAttributesResponse$'
        - '.+/typedef\.SzDiagnosticGetRepositoryInfoResponse$'
        - '.+/typedef\.SzEngineGetStatsResponse$'
        - '.+/typedef\.SzProductGetLicenseResponse$'
        - '.+/typedef\.SzProductGetVersionResponse$'
        - '.+/typedef\.SzEngineGetVirtualEntityByRecordIDResponse$'
    funlen:
      lines: 160
      statements: 50
    ireturn:
      allow:
        - senzing.SzAbstractFactory

formatters:
  enable:
    - gci
    - gofmt
    - gofumpt
    - goimports
    - golines
  exclusions:
    generated: lax
    paths:
      - third_party$
      - builtin$
      - examples$
  settings:
    golines:
      max-len: 120
