generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.golangci.yaml
143 lines (130 loc) · 3.7 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
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
run:
modules-download-mode: readonly
timeout: 10m
build-tags:
- e2e
linters:
enable-all: true
disable:
# Depreacted linters
- gomnd
- execinquery
- exportloopref
# Linters to be enabled after fixing the issues
- intrange
- cyclop
- depguard
- exhaustive
- exhaustruct
- forcetypeassert
- funlen
- gochecknoglobals
- goconst
- gocritic
- godot
- godox
- err113
- gofumpt
- mnd
- ireturn
- lll
- maintidx
- makezero
- mirror
- nestif
- nlreturn
- noctx
- nonamedreturns
- paralleltest
- perfsprint
- prealloc
- protogetter
- tagliatelle
- testpackage
- varnamelen
- whitespace
- wrapcheck
- wsl
linters-settings:
dupl:
threshold: 100 # Tokens count to trigger error.
importas:
no-unaliased: true
no-extra-aliases: true
alias:
- pkg: "k8s.io/apimachinery/pkg/apis/meta/v1"
alias: metav1
- pkg: "k8s.io/client-go/dynamic/fake"
alias: dynamicfake
- pkg: "k8s.io/client-go/testing"
alias: clienttesting
errcheck:
check-type-assertions: true # Reports type assertions: `a := b.(SomeStruct)`.
check-blank: true # Report assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`.
exclude-functions: # List of functions to exclude from checking.
- io/ioutil.ReadFile
- io.Copy(*bytes.Buffer)
- io.Copy(os.Stdout)
- gopkg.in/yaml.v3.Marshal
errchkjson:
check-error-free-encoding: true
report-no-exported: true
gci:
sections:
- standard # Standard packages.
- default # Imports that could not be matched to another section type.
- prefix(github.com/kyma-project/opentelemetry-collector-components) # Imports with the specified Prefix.
- blank # Blank imports
custom-order: true
goimports:
local-prefixes: github.com/kyma-project/opentelemetry-collector-components
govet:
enable:
- shadow
loggercheck:
klog: true # Allows checking for the k8s.io/klog/v2.
zap: true # Allows checking for the go.uber.org/zap.
kitlog: false # Prohibits checking for the github.com/go-kit/log.
logr: false # Prohibits checking for the github.com/go-logr/logr.
require-string-key: true # Require all logging keys to be inlined constant strings.
no-printf-like: true
misspell:
locale: US
nolintlint:
allow-unused: true
require-explanation: true
require-specific: true
revive:
rules:
- name: dot-imports
disabled: true
gocyclo:
# Minimal code complexity to report.
# Default: 30
# The max complexity while enabling this linter is 15. Please check if this can be reduced. Increase the threshold only if it is absolutely necessary.
min-complexity: 15
gomoddirectives:
# allow local replaces
replace-local: true
issues:
exclude:
# Check this issue for more info: https://github.com/kyoh86/scopelint/issues/4
- Using the variable on range scope `tc` in function literal
- Using the variable on range scope `tt` in function literal
exclude-rules:
- path: _test\.go
linters:
- errcheck
- dupl
- path: _test\.go
text: "shadow: declaration of \"ctx\" shadows declaration at line ([\\d]+)"
linters:
- govet
- path: .go
text: "shadow: declaration of \"err\" shadows declaration at line ([\\d]+)"
linters:
- govet
# Unify components checkers after getting rid of custom conditions in favor of metav1.Conditions
- linters:
- importas
text: has alias "" which is not part of config # Ignore false positives that emerged due to https://github.com/julz/importas/issues/15.