-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.golangci.yml
125 lines (121 loc) · 3.02 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
125
run:
timeout: 5m
issues-exit-code: 1
tests: false
modules-download-mode: readonly
allow-parallel-runners: true
output:
print-issued-lines: true
print-linter-name: true
linters:
disable:
- depguard
- exhaustruct
- fatcontext
- gochecknoglobals
- goconst
- godot
- godox
- nonamedreturns
- nlreturn
- varnamelen
- inamedparam
- wsl
- wrapcheck
presets:
- bugs
- comment
- complexity
- error
- format
- import
- metalinter
- module
- performance
- style
- test
- unused
linters-settings:
exhaustive:
ignore-enum-members: '^*(Unspecified|Undefined|Unknown|Idle)$'
cyclop:
max-complexity: 20
gomnd:
ignored-numbers:
- '2'
- '4'
- '8'
- '16'
- '32'
- '64'
gci:
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(github.com/einouqo/ext-kit) # Custom section: groups all imports with the specified Prefix.
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
- dot
tagliatelle:
case:
rules:
json: snake
yaml: snake
issues:
exclude-dirs:
- test # no lints for tests
exclude-files:
- .*_test.go$ # unit tests
- transport/ws/intercepting_writer.go # code from http package of go-kit project (https://github.com/go-kit/kit/blob/master/transport/http/intercepting_writer.go).
exclude-rules:
- linters:
- wrapcheck
text: 'error returned from interface method should be wrapped'
source: ^*return .*
- linters:
- wrapcheck
text: ^error returned from external package is unwrapped[:] .*multierror.* error$
- linters:
- wrapcheck
source: .*status.Error\(.*, .*\).*
- linters:
- cyclop
text: 'calculated cyclomatic complexity for function'
source: ^func \(.*\) String\(\) string {$
- linters:
- gomnd
source: .*(time\..|[0-9]+<<[0-9]+)*$
- linters:
- gofumpt
source: ^var \(
- linters:
- unparam
# except setters with self returning
text: .*\)\.set([A-z0-9]+)? - result 0 \(\*.*\) is never used$
- linters:
- gosec
text: 'G109:'
- linters:
- gosec
text: 'G404:'
- linters:
- lll
source: .*// .*
- linters:
- stylecheck
text: 'ST1012:'
- linters:
- forbidigo
text: use of `fmt\..*` forbidden by pattern `.*`$
- path: transport # ok for transport
linters: [ gocognit, gocyclo, cyclop, forcetypeassert, funlen, ireturn, lll ]
- path: endpoint
linters: [ errname, revive ]
- linters:
- gocritic
text: 'appendAssign: append result not assigned to the same slice'
- linters:
- errcheck
source: ^\s*defer .*$
- linters:
- revive
text: 'if-return: redundant if ...;'