version: "2"

run:
  timeout: 5m
  tests: true
  modules-download-mode: readonly

linters:
  enable:
    - revive
    - errcheck
    - staticcheck
    - govet
    - ineffassign
    - unparam
    - misspell
    - errorlint
    - gocritic

  exclusions:
    paths:
      - ".*_mock\\.go"
      - ".*\\.pb\\.go"
      - "testdata/.*"
    rules:
      # Relax rules for test files
      - path: _test\.go
        linters:
          - revive
          - gocritic
      - linters: [misspell]
        text: "Statuser"

  settings:
    misspell:
      locale: US
      ignore-rules:
        - "statuser"
    gocritic:
      enabled-checks:
        # Style
        - boolExprSimplify
        - commentedOutCode
        - emptyStringTest

        # Performance
        - hugeParam
        - rangeValCopy

        # Bug detection
        - nilValReturn

    unparam:
      check-exported: false

    revive:
      rules:
        # Documentation
        - name: exported
        - name: package-comments

        # Code quality
        - name: unused-parameter
        - name: var-naming
        - name: function-result-limit
          arguments: [3]
        - name: argument-limit
          arguments: [5]
        - name: cyclomatic
          arguments: [10]

        # Error handling
        - name: error-return
        - name: error-strings
        - name: error-naming

        # Best practices
        - name: context-as-argument
        - name: empty-block
        - name: superfluous-else

formatters:
  enable:
    - goimports
  settings:
    goimports:
      local-prefixes: [github.com/bmf-san/ggc]

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