-
Notifications
You must be signed in to change notification settings - Fork 22
/
.golangci.yml
108 lines (105 loc) · 3.11 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
# options for analysis running
run:
# default concurrency is a available CPU number
concurrency: 4
# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 10m
linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- typecheck
- dupl
- goprintffuncname
- govet
- nolintlint
#- rowserrcheck
- gofmt
- revive
- goimports
- misspell
- bodyclose
- unconvert
- ineffassign
- staticcheck
- exportloopref
- depguard
- dogsled
- errcheck
#- funlen
- gci
- goconst
- gocritic
- gocyclo
- gosimple
- stylecheck
- unused
- unparam
- unconvert
- whitespace
issues:
include:
- EXC0002 # disable excluding of issues about comments from golint
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- path: _test\.go
linters:
- gomnd
- dupl
# Exclude because: "string `Deployment` has 3 occurrences, but such constant `Deployment` already exists"
# but we don't need to make them constants
- path: controllers/keda/transform/transform.go
linters:
- goconst
# Exclude because: "string `Deployment` has 3 occurrences, but such constant `Deployment` already exists"
# but we don't need to make them constants
# and:
# "exported: type name will be used as keda.KedaControllerReconciler by other packages, and that stutters;
# consider calling this ControllerReconciler (revive)"
- path: controllers/keda/kedacontroller_controller.go
linters:
- goconst
- revive
# Exclude for controllers, reason:
# "controllers/configmap_controller.go:49: 49-80 lines are duplicate of `controllers/secret_controller.go:49-80`"
- path: _controller.go
linters:
- dupl
# Exclude because: "controllers/suite_test.go:157:63: `getObject` - `namespace` always receives `namespace` (`"keda"`)"
- path: controllers/keda/suite_test.go
linters:
- unparam
# Exclude because: "declaration has 3 blank identifiers" -> it's ok, we don't need them
- path: resources/resources_handler.go
linters:
- dogsled
- path: main.go
linters:
- gci
# https://github.com/go-critic/go-critic/issues/926
- linters:
- gocritic
text: "unnecessaryDefer:"
- linters:
- stylecheck
text: "ST1000:"
# Exclude some linters from running on test files.
- path: _test\.go$
text: "dot-imports: should not use dot imports"
linters-settings:
funlen:
lines: 80
statements: 40
gci:
sections:
- standard
- default
- prefix(github.com/kedacore/keda)
# copied from https://github.com/kedacore/keda/blob/1ab35e75a63b3b33ca59552dda93220fd916a05d/.golangci.yml#L163-L168
depguard: #https://github.com/kedacore/keda/issues/4980
rules:
main:
deny:
- pkg: sync/atomic
desc: "use type-safe atomics from go.uber.org/atomic"