# https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
run:
  concurrency: 70
  timeout: 10m
  skip-dirs:
    - "(^|/)mocks($|/)"
  allow-parallel-runners: true
  modules-download-mode: vendor
linters:
  enable:
    - asciicheck
    - bodyclose
    - cyclop
    - deadcode
    - depguard
    - dogsled
    - dupl
    - durationcheck
    - errcheck
    - errorlint
    - exhaustive
    - exportloopref
    - forbidigo
    - gci
    - gochecknoinits
    - gocognit
    - goconst
    - gocritic
    - gocyclo
    - gofmt
    - gofumpt
    - goheader
    - goimports
    - gomnd
    - gomoddirectives
    - gomodguard
    - goprintffuncname
    - gosec
    - gosimple
    - govet
    - ifshort
    - importas
    - ineffassign
    - makezero
    - misspell
    - nakedret
    - nilerr
    - noctx
    - prealloc
    - predeclared
    - revive
    - rowserrcheck
    - sqlclosecheck
    - staticcheck
    - structcheck
    - stylecheck
    - testpackage
    - thelper
    - tparallel
    - typecheck
    - unconvert
    - unused
    - varcheck
    - wastedassign
  disable:
    - wsl
    - interfacer
    - gochecknoglobals
    - nolintlint
    - goerr113
    - lll
    - exhaustivestruct
    - nlreturn
    - whitespace
    - nestif
    - scopelint
    - godox
    - godot
    - unparam
    - wrapcheck
    - forcetypeassert
    - paralleltest
    - maligned
    - funlen
linters-settings:
  gomoddirectives:
    replace-allow-list:
      - github.com/coreos/bbolt
  importas:
    alias:
      - pkg: k8s.io/apimachinery/pkg/apis/(\w+)/(v[\w\d]+)
        alias: $1$2
      - pkg: github.com/logicmonitor/k8s-argus/pkg/log
        alias: lmlog
      - pkg: github.com/logicmonitor/k8s-argus/pkg/rl
        alias: rlm
      - pkg: github.com/logicmonitor/k8s-argus/pkg/utilities
        alias: util
      - pkg: k8s.io/api/(\w+)/(v[\w\d]+)
        alias: $1$2
      - pkg: github.com/sirupsen/logrus
        alias: logrus
      - pkg: k8s.io/client-go/tools/cache
        alias: toolscache
      - pkg: github.com/logicmonitor/k8s-argus/pkg/rl
        alias: ratelimiter
      - pkg: k8s.io/apimachinery/pkg/types
        alias: k8stypes
  gomodguard:
    allowed:
      domains:
        - golang.org
        - k8s.io
        - google.golang.org/grpc
        - github.com/prometheus
        - github.com/go-openapi
        - github.com/google
        - github.com/coreos/etcd
        - github.com/golang
    
      modules:
        - github.com/sirupsen/logrus
        - github.com/robfig/cron/v3
        - github.com/Knetic/govaluate
        - github.com/stretchr/testify
        - github.com/kelseyhightower/envconfig
        - github.com/spf13/cobra
        - gopkg.in/yaml.v3
        - github.com/logicmonitor/lm-sdk-go
        - github.com/logicmonitor/k8s-collectorset-controller
        - github.com/pkg/profile
        - github.com/senseyeio/duration
    
    blocked:
      modules:
        - gopkg.in/yaml.v2:
            recommendations:
              - gopkg.in/yaml.v3
            reason: "v3 is recommended to use, not v2"
        - github.com/davecgh/go-spew:
            reason: considered to be log flooder; not supposed to use as it dumps whole object using reflection
