-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.golangci.yaml
More file actions
116 lines (116 loc) · 3.03 KB
/
Copy path.golangci.yaml
File metadata and controls
116 lines (116 loc) · 3.03 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
version: "2"
run:
build-tags:
- e2e
linters:
default: none
settings:
importas:
no-unaliased: true
alias:
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
alias: metav1
- pkg: k8s.io/api/(\w+)/(v[\w\d]+)
alias: $1$2
- pkg: go.opendefense.cloud/solar/api/solar/v1alpha1
alias: solarv1alpha1
dogsled:
# Checks assignments with too many blank identifiers.
# Default: 2
max-blank-identifiers: 4
exhaustive:
default-signifies-exhaustive: true
gosec:
excludes:
- G101 # Look for hardcoded credentials
- G204 # Audit use of command execution
- G306 # Poor file permissions used when writing to a file
modernize:
disable:
- omitzero
nlreturn:
block-size: 2
staticcheck:
checks: ["all", "-ST1000", "-ST1001", "-ST1003", "-ST1005", "-ST1012", "-ST1016", "-ST1020", "-ST1021", "-ST1022", "-QF1001", "-QF1003", "-QF1008"]
exclusions:
generated: lax
presets: [comments, common-false-positives, legacy, std-error-handling]
paths: [third_party, builtin$, examples$]
rules:
# e2e helpers legitimately shell out to kubectl and print progress, and
# some helper params are fixed by design; these checks target production
# code paths, not test scaffolding.
- path: test/e2e
linters: [noctx, forbidigo, unparam]
warn-unused: true
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- contextcheck
- copyloopvar
- decorder
- dogsled
- dupword
- durationcheck
- errcheck
- errchkjson
- errname
- exhaustive
- exptostd
- forbidigo
- ginkgolinter
- gocheckcompilerdirectives
- gochecksumtype
- gocritic
- goheader
- goprintffuncname
- gosec
- gosmopolitan
- govet
- grouper
- importas
- ineffassign
- interfacebloat
- intrange
- loggercheck
- makezero
- mirror
- misspell
- modernize
- musttag
- nakedret
- nilerr
- nilnil
- nlreturn
- noctx
- nosprintfhostport
- predeclared
- promlinter
- protogetter
- reassign
- sloglint
- staticcheck
- testableexamples
- unconvert
- unparam
- unused
- usestdlibvars
- usetesting
- wastedassign
formatters:
enable: [gci, gofmt]
settings:
gci:
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
custom-order: true
exclusions:
generated: lax
paths: [third_party, builtin$, examples$]