.golangci.yml raw

   1  version: "2"
   2  
   3  formatters:
   4    enable:
   5      - gci
   6      - gofumpt
   7    settings:
   8      gofumpt:
   9        extra-rules: true
  10  
  11  linters:
  12    default: all
  13    disable:
  14      - cyclop # duplicate of gocyclo
  15      - dupl
  16      - err113
  17      - exhaustive
  18      - exhaustruct
  19      - forcetypeassert
  20      - lll
  21      - mnd
  22      - nlreturn
  23      - noctx
  24      - paralleltest
  25      - prealloc
  26      - rowserrcheck # not relevant (SQL)
  27      - sqlclosecheck # not relevant (SQL)
  28      - testpackage
  29      - tparallel
  30      - varnamelen
  31      - wrapcheck
  32      - wsl # Deprecated
  33  
  34    settings:
  35      depguard:
  36        rules:
  37          main:
  38            deny:
  39              - pkg: github.com/instana/testify
  40                desc: not allowed
  41              - pkg: github.com/pkg/errors
  42                desc: Should be replaced by standard lib errors package
  43      funlen:
  44        lines: -1
  45        statements: 40
  46      goconst:
  47        min-len: 5
  48        min-occurrences: 3
  49      gocritic:
  50        disabled-checks:
  51          - sloppyReassign
  52          - unnamedResult
  53          - rangeValCopy
  54          - octalLiteral
  55          - paramTypeCombine # already handle by gofumpt.extra-rules
  56        enabled-tags:
  57          - diagnostic
  58          - style
  59          - performance
  60        settings:
  61          hugeParam:
  62            sizeThreshold: 100
  63      gocyclo:
  64        min-complexity: 15
  65      godox:
  66        keywords:
  67          - FIXME
  68      gosec:
  69        excludes:
  70          - G306
  71      govet:
  72        disable:
  73          - fieldalignment
  74        enable-all: true
  75      misspell:
  76        locale: US
  77      perfsprint:
  78        err-error: true
  79        errorf: true
  80        sprintf1: true
  81        strconcat: false
  82  
  83    exclusions:
  84      warn-unused: true
  85      presets:
  86        - comments
  87      rules:
  88        - linters:
  89            - funlen
  90          path: .*_test.go
  91        - path: types.go
  92          text: type Dns(.+) should be DNS(.+)
  93        - path: params.go
  94          text: type Dns(.+) should be DNS(.+)
  95  
  96  issues:
  97    max-issues-per-linter: 0
  98    max-same-issues: 0
  99