forked from shirou/gopsutil
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yml
More file actions
159 lines (159 loc) · 4.02 KB
/
Copy path.golangci.yml
File metadata and controls
159 lines (159 loc) · 4.02 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
version: "2"
formatters:
enable:
- gci
- gofumpt
settings:
gci:
sections:
- standard
- default
- prefix(github.com/shirou)
issues:
max-same-issues: 0
linters:
enable:
- asciicheck
- contextcheck
- durationcheck
- errorlint
- fatcontext
- gocritic
- gomodguard
- gosec
- govet
- importas
- ineffassign
- misspell
- nakedret
- nilnesserr
- noctx
- nolintlint
- perfsprint
- predeclared
- revive
- staticcheck
- testifylint
- thelper
- unparam
- usetesting
disable:
- errcheck
- unused
settings:
gocritic:
disabled-checks:
- captLocal
- commentedOutCode
- deferInLoop
- hexLiteral
- hugeParam
- tooManyResultsChecker
- unnamedResult
enable-all: true
gomodguard:
blocked:
modules:
- io/ioutil:
recommendations:
- io
- os
gosec:
excludes:
- G115
govet:
disable:
- copylocks
- fieldalignment
- testinggoroutine
enable-all: true
perfsprint:
# Optimizes even if it requires an int or uint type cast.
int-conversion: true
# Optimizes into `err.Error()` even if it is only equivalent for non-nil errors.
err-error: true
# Optimizes `fmt.Errorf`.
errorf: true
# Optimizes `fmt.Sprintf` with only one argument.
sprintf1: true
# Optimizes into strings concatenation.
strconcat: true
revive:
rules:
- name: blank-imports
- name: context-as-argument
arguments:
- allowTypesBefore: "*testing.T"
- name: context-keys-type
- name: dot-imports
- name: duplicated-imports
- name: early-return
arguments:
- "preserveScope"
- name: empty-block
disabled: true
- name: error-naming
- name: error-return
- name: error-strings
- name: exported
disabled: true
- name: errorf
- name: increment-decrement
- name: indent-error-flow
arguments:
- "preserveScope"
- name: range
- name: receiver-naming
- name: redefines-builtin-id
- name: redundant-import-alias
- name: superfluous-else
arguments:
- "preserveScope"
- name: time-date
- name: time-equal
- name: time-naming
- name: unexported-return
- name: unnecessary-stmt
- name: unreachable-code
- name: unused-parameter
- name: unused-receiver
- name: use-any
- name: var-declaration
- name: var-naming
arguments:
- ["ID"] # AllowList
- ["VM"] # DenyList
- - upperCaseConst: true # Extra parameter (upperCaseConst|skipPackageNameChecks)
skipPackageNameChecks: true
staticcheck:
checks:
- all
- -SA1019 # Using a deprecated function, variable, constant or field
- -SA2002 # Called testing.T.FailNow or SkipNow in a goroutine, which isn’t allowed
- -SA4003 # Comparing unsigned values against negative values is pointless
- -SA4004 # The loop exits unconditionally after one iteration
- -SA4008 # The variable in the loop condition never changes, are you incrementing the wrong variable?
- -SA5003 # Defers in infinite loops will never execute
- -SA9003 # Empty body in an if or else branch
- -ST1003 # Poorly chosen identifier
testifylint:
enable-all: true
usetesting:
os-create-temp: false
os-mkdir-temp: false
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- text: 'shadow: declaration of "err" shadows declaration at line'
linters:
- govet
warn-unused: true
output:
show-stats: false
run:
timeout: 5m