generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 18
/
.golangci.yaml
103 lines (103 loc) · 3.74 KB
/
.golangci.yaml
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
linters:
enable-all: true
disable:
- contextcheck # too many false positives
- depguard # checks if package imports are whitelisted
- exhaustruct # too subjective and harms code readability
- exportloopref # deprecated (since v1.60.2), replaced by copyloopvar
- gomnd # deprecated (since v1.58.0), renamed to mnd
- lll
- nlreturn # too strict and mostly code is not more readable
- sqlclosecheck # not needed for this project
- paralleltest # should be enabled consciously for long-running tests
- wsl # too strict and mostly code is not more readable
linters-settings:
gomoddirectives:
replace-local: true
replace-allow-list:
- github.com/kyma-project/template-operator/api
stylecheck:
dot-import-whitelist:
- github.com/onsi/ginkgo/v2
- github.com/onsi/gomega
revive:
severity: error
rules:
- name: comment-spacings
disabled: true
- name: dot-imports
severity: warning
disabled: true
- name: line-length-limit
severity: warning
disabled: true
arguments: [ 120 ]
funlen:
lines: 80
cyclop:
max-complexity: 20
nestif:
min-complexity: 6
gci:
sections:
- standard # Standard packages.
- default # Imports that could not be matched to another section type.
- prefix(github.com/kyma-project/template-operator) # Imports with the specified prefix.
- blank # Blank imports.
- dot # Dot imports.
custom-order: true
skip-generated: true
nolintlint:
require-explanation: true
ireturn:
allow:
- anon
- error
- empty
- stdlib
- Client
- record.EventRecorder
- client.Object
- schema.ObjectKind #api/v1beta2/moduletemplate_types.go
- runtime.Object #api/v1beta2/moduletemplate_types.go
- meta.RESTMapper #internal/declarative/v2/client_proxy.go, internal/declarative/v2/rest_getter_proxy.go
- client.SubResourceWriter #internal/declarative/v2/client_proxy.go
- openapi.Resources #internal/declarative/v2/kube_factory_proxy.go
- validation.Schema #internal/declarative/v2/kube_factory_proxy.go
- discovery.CachedDiscoveryInterface #internal/declarative/v2/rest_getter_proxy.go
- machineryruntime.Object #internal/declarative/v2/ssa.go
- v1.Layer #internal/manifest/parse.go, tests/integration/controller/manifest/manifest.go
- authn.Keychain #internal/manifest/spec_resolver.go, pkg/ocmextensions/cred.go
- ratelimiter.RateLimiter #internal/rate_limiter.go
varnamelen:
ignore-names:
- ok
ignore-type-assert-ok: true
ignore-map-index-ok: true
ignore-chan-recv-ok: true
exhaustruct:
exclude:
- gdfs
issues:
exclude-files:
- zz_generated.deepcopy.go
exclude-rules:
- path: "_test\\.go"
linters:
- wrapcheck # Errors do not need to be wrapped in unit and integration tests
- err113 # Dynamic error creation in unit and integration tests is ok
- gochecknoglobals # Does not apply to unit and integration tests
- funlen # Table driven unit and integration tests exceed function length by design
- maintidx # Table driven unit and integration tests exceed maintainability index by design
- linters:
- lll
source: "^// +kubebuilder: " # Exclude lll issues for long lines starting with kubebuilder marker prefix
- linters:
- lll # Exclude lll issues for long lines starting with an url
source: "^// http "
max-issues-per-linter: 0
max-same-issues: 0
output:
sort-results: true
run:
timeout: 15m