forked from kedacore/keda-olm-operator
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.golangci.yml
More file actions
113 lines (105 loc) · 2.99 KB
/
Copy path.golangci.yml
File metadata and controls
113 lines (105 loc) · 2.99 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
version: "2"
# 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:
default: none
enable:
- dupl
- goprintffuncname
- govet
- nolintlint
#- rowserrcheck
- revive
- misspell
- bodyclose
- unconvert
- ineffassign
- staticcheck
#- exportloopref deprecated as of 1.60.2
- depguard
- dogsled
- errcheck
#- funlen
- goconst
- gocritic
- gocyclo
- unused
- unparam
- whitespace
settings:
funlen:
lines: 80
statements: 40
# 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"
revive:
rules:
# Disable rules that require comments on all exported types
- name: exported
disabled: true
- name: package-comments
disabled: true
- name: var-naming
disabled: true
# Defines a set of rules to ignore issues
exclusions:
# Use presets for common exclusions
presets:
- comments
- std-error-handling
- common-false-positives
# Excluding configuration per-path, per-linter, per-text and per-source
rules:
- path: _test\.go
linters:
- dupl
# Exclude because: "string `Deployment` has 3 occurrences, but such constant `Deployment` already exists"
# but we don't need to make them constants
- path: internal/controller/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
- path: internal/controller/keda/kedacontroller_controller\.go
linters:
- goconst
# Exclude for controllers, reason:
# "internal/controller/configmap_controller.go:49: 49-80 lines are duplicate of `internal/controller/secret_controller.go:49-80`"
- path: _controller\.go
linters:
- dupl
# Exclude because: "internal/controller/suite_test.go:157:63: `getObject` - `namespace` always receives `namespace` (`"keda"`)"
- path: internal/controller/keda/suite_test\.go
linters:
- unparam
- goconst
# Exclude because: "declaration has 3 blank identifiers" -> it's ok, we don't need them
- path: resources/resources_handler\.go
linters:
- dogsled
- linters:
- staticcheck
text: "ST1000:"
formatters:
enable:
- gofmt
- goimports
- gci
settings:
gci:
sections:
- standard
- default
- prefix(github.com/kedacore/keda-olm-operator)
exclusions:
paths:
- cmd/main\.go