# yaml-language-server: $schema=https://golangci-lint.run/jsonschema/golangci.jsonschema.json
version: "2"
linters:
  default: none
  enable:
  - bodyclose
  - copyloopvar
  - depguard
  - dogsled
  - errcheck
  - errorlint
  - funlen
  - gochecknoinits
  - gocritic
  - gocyclo
  - gosec
  - govet
  - misspell
  - nilerr
  - unconvert
  - unused
  - whitespace
  settings:
    depguard:
      rules:
        main:
          deny:
          - pkg: io/ioutil
            desc: Use the "io" and "os" packages instead.
    dupl:
      threshold: 100
    funlen:
      lines: 300
      statements: 300
    goconst:
      min-len: 2
      min-occurrences: 3
    gocritic:
      enabled-checks:
      - importShadow
      - nestingReduce
      - stringsCompare
      # - unnamedResult
      # - whyNoLint
      disabled-checks:
      - assignOp
      - appendAssign
      - commentedOutCode
      - hugeParam
      - ifElseChain
      - singleCaseSwitch
      - sloppyReassign
      enabled-tags:
      - diagnostic
      - performance
      # - experimental
      # - opinionated
      # - style
    gocyclo:
      min-complexity: 99
    govet:
      disable:
      - fieldalignment
      - shadow
      enable-all: true
    misspell:
      locale: US
  # exclude some linters from running on certains files.
  exclusions:
    generated: lax
    presets:
    - comments
    - common-false-positives
    - legacy
    - std-error-handling
    rules:
    - linters:
      - paralleltest
      path: functional.*_test\.go
    - path: (.+)\.go$
      text: 'G115: integer overflow conversion'
    - path: (.+)\.go$
      text: 'G404: Use of weak random number generator'
    paths:
    - third_party$
    - builtin$
    - examples$
issues:
  # maximum count of issues with the same text. set to 0 for unlimited. default is 3.
  max-same-issues: 0
formatters:
  enable:
  - gofmt
  - goimports
  settings:
    goimports:
      local-prefixes:
      - github.com/IBM/sarama
  exclusions:
    generated: lax
    paths:
    - third_party$
    - builtin$
    - examples$
