version: "2"

run:
  timeout: 10m

linters:
  enable:
    - errcheck
    - staticcheck
    - ineffassign
    - unused
    - misspell
    - unconvert
    - unparam
    - errorlint
    - gocritic
    - sloglint
  exclusions:
    paths:
      - client # separate Go module with own go.mod
    rules:
      # Exclude test file noise for linters that only flag test patterns
      - path: '_test\.go'
        linters:
          - errcheck
          - unparam
          - gocritic
          - sloglint
      # QF1008: explicit embedded field selectors are intentional to avoid naming
      # conflicts (e.g., larkClient.Im.V1 vs local embedded Im field).
      - path: 'feishu/(adapter|streaming|typing|sdk_logger)\.go'
        linters:
          - staticcheck
        text: 'QF1008'
      - path: 'worker/claudecode/worker\.go'
        linters:
          - staticcheck
        text: 'QF1008'
      - path: 'security/jwt\.go'
        linters:
          - staticcheck
        text: 'QF1008'
      # ST1000: package comments are low-value for small/internal packages
      - linters:
          - staticcheck
        text: 'ST1000'
      # ST1020: comment format suggestions on non-public-APIs
      - linters:
          - staticcheck
        text: 'ST1020'
      # ST1003: ALL_CAPS constant naming (FEISHU_CARD_TABLE_LIMIT)
      - linters:
          - staticcheck
        text: 'ST1003'
      # QF1003: tagged switch suggestions (style preference)
      - linters:
          - staticcheck
        text: 'QF1003'
      # importShadow: intentional local shadowing of imported package names
      - linters:
          - gocritic
        text: 'importShadow'
      # gocritic from third-party node_modules (can't modify)
      - path: 'node_modules/'
        linters:
          - gocritic
          - staticcheck
      # paramTypeCombine: third-party code
      - path: 'examples/typescript-client/node_modules/'
        linters:
          - gocritic
      # gocritic style suggestions in markdown pipeline (experimental feature)
      - path: 'messaging/feishu/markdown\.go'
        linters:
          - gocritic
          - staticcheck
  settings:
    errcheck:
      check-type-assertions: true
      check-blank: false
    sloglint:
      no-mixed-args: true
      key-naming-case: snake
    gocritic:
      enabled-tags:
        - diagnostic
        - style
      disabled-checks:
        - builtinShadow
        - unnamedResult
        - typeDefFirst
        - ifElseChain
        - typeAssertChain

formatters:
  enable:
    - gofmt
    - goimports
  settings:
    goimports:
      local-prefixes:
        - github.com/hrygo/hotplex

issues:
  max-issues-per-linter: 0
  max-same-issues: 0
