forked from cilium/hubble
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
96 lines (94 loc) · 2.33 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
# See https://golangci-lint.run/usage/configuration/ for available options.
# Also https://github.com/cilium/cilium/blob/master/.golangci.yaml as a
# reference.
run:
go: '1.20'
timeout: 3m # default is 1m
linters:
disable-all: true
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- contextcheck
- decorder
- dupword
- durationcheck
- errchkjson
- errname
- gocheckcompilerdirectives
- gocritic
- goerr113
- gofmt
- goheader
- goimports
- goprintffuncname
- gosec
- gosimple
- govet
- importas
- ineffassign
- interfacebloat
- makezero
- misspell
- musttag
- nakedret
- nilerr
- noctx
- nosprintfhostport
- predeclared
- reassign
- revive
- staticcheck
- tenv
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- wastedassign
linters-settings:
goheader:
values:
regexp:
PROJECT: 'Cilium|Hubble'
template: |-
SPDX-License-Identifier: Apache-2.0
Copyright Authors of {{ PROJECT }}
govet:
enable-all: true
disable:
- fieldalignment
- shadow
importas:
no-unaliased: true
alias:
- pkg: github.com/cilium/cilium/api/v1/flow
alias: flowpb
- pkg: github.com/cilium/cilium/api/v1/observer
alias: observerpb
- pkg: github.com/cilium/cilium/api/v1/relay
alias: relaypb
issues:
# Default rules exclude Go doc comments check, which is rather unfortunate.
# In order to enable Go doc checks, defaults rules have to be disabled.
# See https://github.com/golangci/golangci-lint/issues/456 for details.
exclude-use-default: false
exclude:
- (G104|G307) # EXC0008 gosec: Duplicated errcheck checks
exclude-rules:
- linters: [staticcheck]
text: "SA1019" # deprecated methods
- linters: [goerr113]
text: "do not define dynamic errors, use wrapped static errors instead"
- linters: [gosec]
text: "G402" # TLS InsecureSkipVerify may be true
- linters: [gosec]
text: "G101" # Potential hardcoded credentials
- linters: [revive]
text: "should have a package comment"
- linters: [dupword]
path: cmd/list/node_test.go # tripping on command output
- linters: [dupword]
path: pkg/printer/printer_test.go # tripping on command output