linters-settings:
  gocyclo:
    min-complexity: 15
  depguard:
    rules:
      Main:
        files:
          - $all
          - "!$test"
        allow:
          - $gostd
          - github.com/bufbuild/protoyaml-go/decode
          - github.com/bufbuild/protovalidate-go
          - buf.build/gen/go/bufbuild/protovalidate
  errcheck:
    check-type-assertions: true
  forbidigo:
    forbid:
      - '^fmt\.Print'
      - '^log\.'
      - '^print$'
      - '^println$'
      - '^panic$'
  godox:
    # TODO, OPT, etc. comments are fine to commit. Use FIXME comments for
    # temporary hacks, and use godox to prevent committing them.
    keywords: [FIXME]
  varnamelen:
    ignore-decls:
      - ok bool
      - T any
      - i int
      - wg sync.WaitGroup
linters:
  enable-all: true
  disable:
    - cyclop            # covered by gocyclo
    - execinquery       # deprecated as of golangci v1.58.0
    - exhaustive
    - exhaustruct
    - exportloopref     # deprecated as of golangci v1.60.2
    - funlen            # rely on code review to limit function length
    - gochecknoglobals
    - gocognit          # dubious "cognitive overhead" quantification
    - gofumpt           # prefer standard gofmt
    - goimports         # rely on gci instead
    - gomnd             # some unnamed constants are okay
    - ireturn           # "accept interfaces, return structs" isn't ironclad
    - lll               # don't want hard limits for line length
    - maintidx          # covered by gocyclo
    - mnd
    - nlreturn          # generous whitespace violates house style
    - nonamedreturns
    - testpackage       # internal tests are fine
    - wrapcheck         # don't _always_ need to wrap errors
    - wsl               # generous whitespace violates house style
issues:
  exclude-dirs-use-default: false
  exclude:
    # Don't ban use of fmt.Errorf to create new errors, but the remaining
    # checks from err113 are useful.
    - "do not define dynamic errors.*"
    # Loosen requirements on tests
  exclude-rules:
    - path: _test.go
      linters:
        - nestif
    - path: internal/*
      linters:
        - depguard
        - revive
        - forbidigo
    - path: internal/protoyamltest/*
      linters:
        - gosec
        - gosmopolitan
        - prealloc
