run:
  timeout: 5m
  tests: true
  skip-dirs:
    - vendor
    - .github

linters:
  enable:
    - errcheck
    - gosimple
    - govet
    - ineffassign
    - staticcheck
    - unused
    - gofmt
    - goimports
    - misspell
    - gocritic
    - revive
    - stylecheck
  disable:
    - typecheck # Can cause issues with generics in some cases

linters-settings:
  errcheck:
    check-type-assertions: false
    check-blank: false

  govet:
    check-shadowing: false

  gofmt:
    simplify: true

  goimports:
    local-prefixes: github.com/bitechdev/ResolveSpec

  gocritic:
    enabled-checks:
      - appendAssign
      - assignOp
      - boolExprSimplify
      - builtinShadow
      - captLocal
      - caseOrder
      - defaultCaseOrder
      - dupArg
      - dupBranchBody
      - dupCase
      - dupSubExpr
      - elseif
      - emptyFallthrough
      - equalFold
      - flagName
      - ifElseChain
      - indexAlloc
      - initClause
      - methodExprCall
      - nilValReturn
      - rangeExprCopy
      - rangeValCopy
      - regexpMust
      - singleCaseSwitch
      - sloppyLen
      - stringXbytes
      - switchTrue
      - typeAssertChain
      - typeSwitchVar
      - underef
      - unlabelStmt
      - unnamedResult
      - unnecessaryBlock
      - weakCond
      - yodaStyleExpr

  revive:
    rules:
      - name: exported
        disabled: true
      - name: package-comments
        disabled: true

issues:
  exclude-use-default: false
  max-issues-per-linter: 0
  max-same-issues: 0

  # Exclude some linters from running on tests files
  exclude-rules:
    - path: _test\.go
      linters:
        - errcheck
        - dupl
        - gosec
        - gocritic

    # Ignore "error return value not checked" for defer statements
    - linters:
        - errcheck
      text: "Error return value of .((os\\.)?std(out|err)\\..*|.*Close|.*Flush|os\\.Remove(All)?|.*print(f|ln)?|os\\.(Un)?Setenv). is not checked"

    # Ignore complexity in test files
    - path: _test\.go
      text: "cognitive complexity|cyclomatic complexity"

output:
  format: colored-line-number
  print-issued-lines: true
  print-linter-name: true
