linters-settings:
  govet:
    enable:
      - atomicalign
      - timeformat
      - shadow
    settings:
      printf:
        funcs:
          - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
          - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
          - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
          - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
  golint:
    min-confidence: 0
  gocyclo:
    min-complexity: 20
  maligned:
    suggest-new: true
  dupl:
   threshold: 150
  goconst:
    min-len: 2
    min-occurrences: 3
  depguard:
    rules:
      main:
        list-mode: lax
        allow:
          - github.com/apex/log
          - github.com/julen-noblet/download-geofabrik/*
  misspell:
    locale: US
  lll:
    line-length: 150
  goimports:
    local-prefixes: github.com/golangci/golangci-lint
  gocritic:
    enabled-tags:
      - diagnostic
      - experimental
      - opinionated
      - performance
      - style
    disabled-checks:
      #- commentedOutCode
      # - hugeParam
      #- wrapperFunc
      #- dupImport # https://github.com/go-critic/go-critic/issues/845
        #- ifElseChain
        #- octalLiteral
  funlen:
    lines: 100
    statements: 50
  unused:
    # treat code as a program (not a library) and report unused exported identifiers; default is false.
    # XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
    # if it's called for subdir of a project it can't find funcs usages. All text editor integrations
    # with golangci-lint call it on a directory with the changed file.
    check-exported: false
  unparam:
    # Inspect exported functions, default is false. Set to true if no external program/library imports your code.
    # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
    # if it's called for subdir of a project it can't find external interfaces. All text editor integrations
    # with golangci-lint call it on a directory with the changed file.
    check-exported: false
  nakedret:
    # make an issue if func has more lines of code than this setting and it has naked returns; default is 30
    max-func-lines: 30
  prealloc:
    # XXX: we don't recommend using this linter before doing performance profiling.
    # For most programs usage of prealloc will be a premature optimization.

    # Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them.
    # True by default.
    simple: true
    range-loops: true # Report preallocation suggestions on range loops, true by default
    for-loops: true # Report preallocation suggestions on for loops, false by default
  whitespace:
    multi-if: false   # Enforces newlines (or comments) after every multi-line if statement
    multi-func: true # Enforces newlines (or comments) after every multi-line function signature
  wsl:
    # If true append is only allowed to be cuddled if appending value is
    # matching variables, fields or types on line above. Default is true.
    strict-append: true
    # Allow calls and assignments to be cuddled as long as the lines have any
    # matching variables, fields or types. Default is true.
    allow-assign-and-call: true
    # Allow multiline assignments to be cuddled. Default is true.
    allow-multiline-assign: true
    # Allow case blocks to end with a whitespace.
    allow-case-traling-whitespace: true
    # Allow declarations (var) to be cuddled.
    allow-cuddle-declarations: false


linters:
  # please, do not use `enable-all`: it's deprecated and will be removed soon.
  # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
  #disable-all: true
  #enable-all: true
  disable:
    - gochecknoglobals
    - exhaustruct
    - nonamedreturns
  presets:
    - bugs
    - comment
    - complexity
    - error
    - format
    - import
    - metalinter
    - module
    - performance
    - sql
    - style
    - test
    - unused

issues:
  exclude-rules:
    - path: _test.go
      linters:
        - gochecknoinits
        - gocyclo
        - cyclop
        - funlen
        - exhaustruct
        - maintidx
        - dupl
        - godox
        - gocognit
        - varnamelen
        - paralleltest
    