.golangci.yml 1.72 KB
run:
  timeout: 5m
linters:
  enable:
    - bodyclose
    - depguard
    - dogsled
    - dupl
    - durationcheck
    - exportloopref
    - exhaustive
    - gochecknoinits
    - goconst
    - gocritic
    - gofmt
    - goimports
    - gomnd
    - gosec
    - govet
    - lll
    - misspell
    - nakedret
    - noctx
    - nolintlint
    - stylecheck
    - unconvert
    - unparam
issues:
  exclude-rules:
    # Excluding single digits from magic number detector because it produces too many obvious results (like klog)
    - text: "Magic number: [0-9]{1},"
      linters:
        - gomnd
    # Exclude file masks from magic number detector because these numbers are obvious
    - text: "Magic number: 0[0-7]{3},"
      linters:
        - gomnd
    # Exlude IP masks netmasks as substituting them for constants only makes these less obvious
    - text: "Magic number: 255,"
      linters:
        - gomnd
      path: pkg/controllers/proxy/network_services_controller.go
    # Exclude IP netmasks from magic number detector because these numbers are obvious
    - text: "Magic number: 32,"
      linters:
        - gomnd
    # Exclude decimal bases from magic number detector because these numbers are obvious
    - text: "Magic number: 10,"
      linters:
        - gomnd
    # Exclude file mask security findings as we are always intentional about the file masks we use
    - text: "G306:"
      linters:
        - gosec
    # Exlude tests from long line linter
    - linters:
        - lll
      path: _test\.go
  # always show all issues rather than only showing 50 at a time
  max-issues-per-linter: 0
  # always show all issues of a type rather than showing 3
  max-same-issues: 0
output:
  format: tab
  print-issued-lines: true
  print-linter-name: true