-
Notifications
You must be signed in to change notification settings - Fork 4.9k
/
Copy path.golangci.yml
executable file
·142 lines (142 loc) · 3.46 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
version: "2"
run:
build-tags:
- integration
linters:
default: none
enable:
- asciicheck
- bodyclose
- depguard
- durationcheck
- errcheck
- errorlint
- forbidigo
- gomoddirectives
- gomodguard
- gosec
- govet
- importas
- ineffassign
- misspell
- nakedret
- nilerr
- noctx
- nolintlint
- staticcheck
- unconvert
- unused
- wastedassign
settings:
depguard:
rules:
apache-licensed-code:
list-mode: lax
files:
- '!**/x-pack/**/*.go'
deny:
- pkg: github.com/elastic/beats/v7/x-pack
desc: Apache 2.0 licensed code cannot depend on Elastic licensed code (x-pack/).
main:
list-mode: lax
deny:
- pkg: math/rand$
desc: superseded by math/rand/v2
errcheck:
check-type-assertions: true
check-blank: false
exclude-functions:
- (github.com/elastic/elastic-agent-libs/mapstr.M).Delete
- (github.com/elastic/elastic-agent-libs/mapstr.M).Put
- github.com/elastic/elastic-agent-libs/logp.TestingSetup
- github.com/elastic/elastic-agent-libs/logp.DevelopmentSetup
errorlint:
errorf: true
asserts: true
comparison: true
forbidigo:
forbid:
- pattern: fmt.Print.*
gomoddirectives:
replace-allow-list:
- github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption
- github.com/Shopify/sarama
- github.com/apoydence/eachers
- github.com/dop251/goja
- github.com/dop251/goja_nodejs
- github.com/fsnotify/fsevents
- github.com/fsnotify/fsnotify
- github.com/google/gopacket
- github.com/insomniacslk/dhcp
- github.com/meraki/dashboard-api-go/v3
- github.com/snowflakedb/gosnowflake
replace-local: false
gomodguard:
blocked:
modules:
- github.com/pkg/errors:
recommendations:
- errors
- fmt
reason: This package is deprecated, use `fmt.Errorf` with `%w` instead
- gotest.tools/v3:
recommendations:
- github.com/stretchr/testify
reason: Use one assertion library consistently across the codebase
- github.com/google/uuid:
recommendations:
- github.com/gofrs/uuid/v5
reason: Use one uuid library consistently across the codebase
gosec:
excludes:
- G306
- G404
- G401
- G501
- G505
nolintlint:
require-explanation: true
require-specific: false
allow-unused: false
prealloc:
simple: false
range-loops: true
for-loops: true
staticcheck:
checks:
- -ST1005
- all
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- staticcheck
text: 'ST1003:'
- linters:
- forbidigo
path: (.*magefile.go|.*dev-tools/mage/.*)
paths:
- third_party$
- builtin$
- examples$
issues:
max-issues-per-linter: 50
max-same-issues: 3
formatters:
enable:
- goimports
settings:
goimports:
local-prefixes:
- github.com/elastic
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$