run:
  build-tags:
    - integration
  timeout: 10m
linters:
  enable:
    - dogsled
    - dupl
    - gofmt
    - goimports
    - gosec
    - misspell
    - nakedret
    - stylecheck
    - unconvert
    - unparam
    - whitespace
linters-settings:
  gosec:
    excludes:
      # duplicates errcheck
      - G104
      # performance issue: see https://github.com/golangci/golangci-lint/issues/4039
      # and https://github.com/securego/gosec/issues/1007
      - G602
issues:
  exclude-use-default: false
  exclude-rules:
    - linters:
        - dupl
        - unparam
        - gosec
        - dogsled
      path: _test\.go

    # We need to pass nil Context in order to test DoBare erroring on nil ctx.
    - linters: [ staticcheck ]
      text: 'SA1012: do not pass a nil Context'
      path: _test\.go

    # We need to use sha1 for validating signatures
    - linters: [ gosec ]
      text: 'G505: Blocklisted import crypto/sha1: weak cryptographic primitive'

    # This is adapted from golangci-lint's default exclusions. It disables linting for error checks on
    # os.RemoveAll and any function ending in "Close".
    - linters: [ errcheck ]
      text: Error return value of .(.*Close|os\.Remove(All)?). is not checked

    # We don't care about file inclusion via variable in examples or internal tools.
    - linters: [ gosec ]
      text: 'G304: Potential file inclusion via variable'
      path: '^(example|tools)\/'
