version: "2"
run:
  go: "1.25"
  timeout: 10m
  modules-download-mode: readonly
  allow-parallel-runners: true
linters:
  enable:
    - depguard
    - exptostd
    - godot
    - godoclint
    - iface
    - iotamixing
    - modernize
    - nilnesserr
    - recvcheck
    - revive
    - sloglint
    - testifylint
    - unconvert
  settings:
    depguard:
      rules:
        forbid-pkg-errors:
          deny:
            - pkg: github.com/pkg/errors
              desc: Should be replaced with standard lib errors or fmt.Errorf
            - pkg: sort
              desc: Should be replaced with slices package
    errcheck:
      exclude-functions:
        # Any error in HTTP handlers is handled by the server itself.
        - (net/http.ResponseWriter).Write
    modernize:
      disable:
        - omitzero
  exclusions:
    generated: strict
    presets:
      - comments
      - common-false-positives
      - legacy
      - std-error-handling
    rules:
      # Disable errcheck linter for test files.
      - linters:
          - errcheck
          - staticcheck
          - testifylint
          - revive
        path: _test.go
    paths:
      - zz_generated.*\.go$
      - examples$
formatters:
  enable:
    - gci
  settings:
    gci:
      sections:
        - standard
        - default
        - prefix(github.com/prometheus-operator/prometheus-operator)
  exclusions:
    generated: strict
    paths:
      - zz_generated.*\.go$
      - examples$
