linters:
  disable-all: true
  enable:
    - bodyclose
    - bidichk
    - decorder
    - containedctx
    - contextcheck
    - dogsled
    - dupl
    - errcheck
    - errchkjson
    - errname
    - execinquery
    - errorlint
    - exportloopref
    - exhaustive
    - goconst
    - godot
    - gocritic
    - gofmt
    - goimports
    - gocyclo
    - goprintffuncname
    - gosec
    - gosimple
    - govet
    - ireturn
    - ineffassign
    - misspell
    - nestif
    - nilerr
    - nilnil
    - nolintlint
    - prealloc
    - predeclared
    - revive
    - staticcheck
    - stylecheck
    - thelper
    - tagliatelle
    - tparallel
    - testpackage
    - tenv
    - typecheck
    - unconvert
    - usestdlibvars
    - unparam
    - unused
    - whitespace
    - wsl

    # disabled
    # - gomnd
    # - varnamelen

linters-settings:
  errcheck:
    check-type-assertions: true
  goconst:
    min-len: 2
    min-occurrences: 3
  gocritic:
    enabled-tags:
      - diagnostic
      - experimental
      - opinionated
      - performance
      - style
  goimports:
    # ensure placement of imports with this prefix after all other imports
    # corresponds to `goimports -local`
    local-prefixes: github.com/ayoisaiah/f2
  gomnd:
    settings:
      mnd:
        # don't include the "operation" and "assign" checks
        checks: argument,case,condition,return
  govet:
    check-shadowing: true
  nestif:
    min-complexity: 15
  nolintlint:
    require-explanation: true
    require-specific: true
  tagliatelle:
    case:
      rules:
        json: snake
  wsl:
    allow-assign-and-anything: true
  varnamelen:
    max-distance: 10
    ignore-decls:
      - t testing.T
      - i int
      - j int
      - ch Change
      - ch *Change
      - c *cli.Context
      - op *Operation

issues:
  fix: false
  exclude-rules:
    - path: _test\.go # disable some linters for test files
      linters:
        - gocyclo
        - gosec
        - dupl
        - varnamelen
    - linters:
        - gosec
      text: "weak cryptographic primitive"
    - linters:
        - stylecheck
      text: "error strings should not be capitalized"
    - linters:
        - typecheck
      text: "undeclared name"

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

run:
  tests: true
  issues-exit-code: 1
  go: ""
