/
.golangci.yml
124 lines (117 loc) · 2.61 KB
/
.golangci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
run:
timeout: 5m
skip-files: []
linters-settings:
govet:
check-shadowing: true
gocyclo:
min-complexity: 16
goconst:
min-len: 3
min-occurrences: 3
misspell:
locale: US
gofumpt:
extra-rules: true
depguard:
list-type: blacklist
include-go-root: false
packages:
- github.com/pkg/errors
godox:
keywords:
- FIXME
gocritic:
enabled-tags:
- diagnostic
- style
- performance
disabled-checks:
- unnamedResult
- hugeParam
- sloppyReassign
- rangeValCopy
- octalLiteral
- paramTypeCombine # already handle by gofumpt.extra-rules
forbidigo:
forbid:
- '^print(ln)?$'
# - '^fmt\.Print(f|ln)?$'
# - '^panic$'
- '^spew\.Print(f|ln)?$'
- '^spew\.Dump$'
gomoddirectives:
replace-local: false
replace-allow-list:
- github.com/abbot/go-http-auth
- github.com/go-check/check
- github.com/gorilla/mux
- github.com/mailgun/minheap
- github.com/mailgun/multibuf
- github.com/docker/docker
funlen:
lines: 120 # default 60
statements: 50 # default 40
linters:
enable-all: true
disable:
# Deprecated
- interfacer
- golint
- maligned
- scopelint
# Too strict
- dupl
- forcetypeassert
- gochecknoglobals
- gochecknoinits
- gocognit
- godox
- goerr113
- gomnd
- gosec
- noctx
- testpackage
- unparam
- wrapcheck
- wsl
# Not relevant
- exhaustive
- exhaustivestruct
- exhaustruct
- ifshort
- lll
- makezero
- nlreturn
- paralleltest
- rowserrcheck # SQL
- sqlclosecheck # SQL
- tparallel
- varnamelen
- ireturn
- nilnil
# Too many false-positive.
- nestif
- prealloc
- bodyclose
- cyclop # Duplicate of gocyclo
issues:
exclude-use-default: false
max-per-linter: 0
max-same-issues: 0
exclude:
- 'ST1000: at least one file in a package should have a package comment'
- 'exported: exported type (.+) should have comment or be unexported'
exclude-rules:
- path: annotations.go
text: (compatibilityMapping) is a global variable
- path: .*_test.go
text: (updateExpected) is a global variable
- path: main.go
text: (Version|ShortCommit|Date) is a global variable
- path: main.go
text: exported var (Version|ShortCommit|Date) should have comment or be unexported
- path: ingress/annotations.go
text: '`getBoolValue` - `defaultValue` always receives `false`'
- path: static/v1.go
text: exported type `(.+)` should have comment or be unexported