# This is for the IDE. We need to duplicate it because the --fast flag doesn’t filter manually enabled linters:
# https://github.com/golangci/golangci-lint/issues/1909.
# The idea was then to duplicate it, rename to -ide.yaml and reference this file in settings.json. That way, default
# manualy golangci-lint run would run all linters as CI. IDE will only run our fast list.
# However, we can’t use variables like ${workspaceRoot} in settings.json. https://github.com/microsoft/vscode/issues/2809.

# Please keep the list in sync.

linters:
  fast: true
  # linters to run in addition to default ones
  enable:
    - dupl
    #- durationcheck
    #- errname
    #- errorlint
    #- exportloopref
    - forbidigo
    - forcetypeassert
    - godot
    - gofmt
    #- gosec
    - ifshort
    - misspell
    - revive
    #- thelper
    #- tparallel
    #- unconvert
    #- unparam
    #- wastedassign
    #- whitespace
    ##- wrapcheck # To think properly about it

# Get all linter issues, even if duplicated
issues:
  exclude-use-default: false
  max-issues-per-linter: 0
  max-same-issues: 0
  exclude:
    # EXC0001 errcheck: most errors are in defer calls, which are safe to ignore and idiomatic Go (would be good to only ignore defer ones though)
    - 'Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv|w\.Stop). is not checked'
    # EXC0008 gosec: duplicated of errcheck
    - (G104|G307)
    # EXC0010 gosec: False positive is triggered by 'src, err := ioutil.ReadFile(filename)'
    - Potential file inclusion via variable
    # revive: unexported-return for functions exported only in tests
    - 'unexported-return: exported func InitialModel(ForTests|WithPrevConfig)? returns unexported type watchdtui.model, which can be annoying to use'
  fix: true # we want this in IDE.

nolintlint:
  require-explanation: true
  require-specific: true

linters-settings:
   # Forbid the usage of deprecated ioutil and debug prints
  forbidigo:
    forbid:
      - ioutil\.
      - ^print.*$
  staticcheck:
    # Should be better for it to be autodetected
    # https://github.com/golangci/golangci-lint/issues/2234
    go: "1.19"