-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yaml
120 lines (120 loc) · 2.87 KB
/
.golangci.yaml
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
linters-settings:
gosimple:
checks: [ "all" ]
govet:
check-shadowing: true
enable-all: true
disable:
- fieldalignment
staticcheck:
checks: [ "all" ]
revive:
ignore-generated-header: true
enable-all-rules: true
rules:
- name: add-constant
disabled: false
arguments:
- maxLitCount: "3"
allowInts: "0,1"
- name: argument-limit
arguments: [ 4 ]
- name: banned-characters
severity: warning
disabled: false
arguments: ["Ω", "Σ", "σ", "ω"]
- name: cognitive-complexity
arguments: [ 9 ]
- name: context-as-argument
arguments:
- allowTypesBefore: "*testing.T"
- name: cyclomatic
arguments: [ 7 ]
- name: defer
arguments:
- [ "call-chain", "loop" ]
- name: file-header
disabled: true
- name: function-result-limit
arguments: [ 3 ] #3 TODO
- name: flag-parameter
disabled: true #4 TODO
- name: function-length
disabled: false
arguments: [ 10, 20 ]
- name: line-length-limit
arguments: [ 120 ]
- name: max-public-structs
arguments: [ 3 ]
- name: string-format
arguments:
- - 'core.WriteError[1].Message'
- '/^([^A-Z]|$)/'
- must not start with a capital letter
- - 'fmt.Errorf[0]'
- '/(^|[^\.!?])$/'
- must not end in punctuation
- - panic
- '/^[^\n]*$/'
- must not contain line breaks
- name: unhandled-error
arguments:
- "fmt.Printf"
stylecheck:
checks: [ "all" ]
gosec:
exclude-generated: true
severity: high
concurrency: 3
gocritic:
enabled-checks:
- hugeParam
- tooManyResultsChecker
- rangeValCopy
- rangeExprCopy
- nestingReduce
- unnamedResult
- truncateCmp
- ruleguard
- elseif
- captLocal
- underef
settings:
captLocal:
paramsOnly: false
elseif:
skipBalanced: false
hugeParam:
sizeThreshold: 256
truncateCmp:
skipArchDependent: false
underef:
skipRecvDeref: false
unnamedResult:
checkExported: true
linters:
disable-all: true
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
- revive
- stylecheck
- gosec
- gocritic
issues:
# See the dedicated "issues" documentation section.
exclude-rules:
- path: _test\.go
text: "add-constant:"
- path: _test\.go
text: "line-length-limit:"
- path: _test\.go
text: "function-length: maximum number of lines"
- path: _test\.go
text: "function-length: maximum number of statements"
- path: '(.*)\/index\.go'
text: "function-length: maximum number of statements"