forked from Dynatrace/dynatrace-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
150 lines (147 loc) · 3.67 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
143
144
145
146
147
148
149
150
linters-settings:
misspell:
locale: US
staticcheck:
checks:
- all
# SA1019 Using a deprecated function, variable, constant or field
# Disabled, because we still support deprecated feature flags, which would cause the linter to complain
- "-SA1019"
govet:
disable:
# Disable checking for copied locks since it causes a lot of annoying false-positives
- copylocks
goconst:
ignore-tests: true
gosec:
excludes:
- G101 # "pattern": "(?i)passwd|pass|password|pwd|secret|private_key|token"
- G305 # File traversal when extracting zip/tar archive
revive:
enable-all-rules: true
rules:
- name: cognitive-complexity
arguments: [20] # max allowed cognitive complexity factor
- name: function-result-limit
arguments: [3]
- name: function-length
# following values set to avoid further regressions:
arguments: [52, 468] # the maximum allowed statements and lines. 0 disables the check
- name: cyclomatic
arguments: [12]
- name: banned-characters
disabled: true
- name: file-header
disabled: true
- name: max-public-structs
disabled: true
- name: argument-limit
arguments: [4]
- name: line-length-limit
disabled: true
- name: add-constant
disabled: true
- name: var-naming
disabled: true
- name: unused-receiver
disabled: true
- name: import-shadowing
disabled: true
- name: modifies-value-receiver
disabled: true
- name: bare-return
disabled: true
- name: bare-return
disabled: true
- name: if-return
disabled: true
- name: redefines-builtin-id
disabled: true
- name: context-keys-type
disabled: true
- name: unused-parameter
disabled: true
- name: time-naming
disabled: true
- name: errorf
disabled: true
- name: unexported-return
disabled: true
- name: unhandled-error
disabled: true
- name: confusing-naming
disabled: true
- name: indent-error-flow
disabled: true
- name: early-return
disabled: true
- name: bool-literal-in-expr
disabled: true
- name: error-strings
disabled: true
- name: empty-lines
disabled: true
- name: flag-parameter
disabled: true
- name: blank-imports
disabled: true
- name: increment-decrement
disabled: true
- name: context-as-argument
disabled: true
- name: confusing-results
disabled: true
- name: receiver-naming
disabled: true
- name: nested-structs
disabled: true
- name: struct-tag
disabled: true
- name: error-naming
disabled: true
- name: range-val-address
disabled: true
linters:
disable-all: true
enable:
- gci
- goimports
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- misspell
- asciicheck
- bodyclose
- depguard
- dogsled
- errorlint
- goconst
- gocritic
- gofmt
- gosec
- nilerr
- prealloc
- revive
- unconvert
- unparam
- whitespace
- unused
- ineffassign
service:
golangci-lint-version: 1.49.x # use the fixed version to not introduce new linters unexpectedly
issues:
exclude-rules:
- linters:
- gosec
path: src/webhook/validation/proxy_url_test.go
- linters:
- gosec
path: src/ingestendpoint/secret_test.go
- linters:
- unparam
text: always receives
- linters:
- revive
path: src/dtclient # it's awaiting refactoring