forked from kubermatic/kubermatic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
131 lines (126 loc) · 3.96 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
# Copyright 2020 The Kubermatic Kubernetes Platform contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
run:
# concurrency=1 lowers memory usage a bit
concurrency: 1
modules-download-mode: readonly
deadline: 20m
build-tags:
- ce
- cloud
- create
- dualstack
- e2e
- ee
- integration
- ipam
- kubevirt
- logout
skip-files:
- zz_generated.*.go
# This package was forked from upstream (in #9826)
# and we want to keep it as close to upstream as possible.
- pkg/provider/cloud/eks/authenticator
linters:
enable:
- asciicheck
- bidichk
- bodyclose
- deadcode
- depguard
- durationcheck
- errcheck
- errname
- errorlint
- exportloopref
- goconst
- gocritic
- gocyclo
- godot
- gofmt
- gosimple
- govet
- importas
- ineffassign
- misspell
- noctx
- nolintlint
- nosprintfhostport
- predeclared
- promlinter
- staticcheck
- structcheck
- tenv
- unconvert
- unused
- varcheck
- wastedassign
- whitespace
disable-all: true
# NOTE: Do not use commas in the exclude patterns, or else the regex will be
# split and you will be sad: https://github.com/golangci/golangci-lint/issues/665
issues:
exclude:
# gocyclo
- cyclomatic complexity [0-9]+ of func `main` is high
- cyclomatic complexity [0-9]+ of func `DefaultConfiguration` is high
- cyclomatic complexity [0-9]+ of func `\(\*Azure\)\.CleanUpCloudProvider` is high
- cyclomatic complexity [0-9]+ of func `\(\*Reconciler\)\.reconcile` is high
- cyclomatic complexity [0-9]+ of func `initTestEndpoint` is high
- cyclomatic complexity [0-9]+ of func `\(\*Provider\)\.InitializeCloudProvider` is high
- cyclomatic complexity [0-9]+ of func `\(\*Reconciler\)\.ensureResourcesAreDeployed` is high
- cyclomatic complexity [0-9]+ of func `GetAPIV2NodeCloudSpec` is high
- cyclomatic complexity [0-9]+ of func `TestKonnectivity` is high
- cyclomatic complexity [0-9]+ of func `validateOpenStackCloudSpec` is high
# gocritic
- singleCaseSwitch # in most cases this is the beginning of a lookup table and should be kept an obvious table
linters-settings:
depguard:
include-go-root: true
packages:
- io/ioutil # https://go.dev/doc/go1.16#ioutil
- github.com/ghodss/yaml # use sigs.k8s.io/yaml instead
importas:
no-unaliased: true
alias:
# KKP
- pkg: k8c.io/kubermatic/v2/pkg/api/v1
alias: apiv1
- pkg: k8c.io/kubermatic/v2/pkg/api/v2
alias: apiv2
- pkg: k8c.io/kubermatic/v2/pkg/apis/apps.kubermatic/v1
alias: appskubermaticv1
- pkg: k8c.io/kubermatic/v2/pkg/apis/kubermatic/v1
alias: kubermaticv1
- pkg: k8c.io/kubermatic/v2/pkg/util/errors
alias: utilerrors
# Kubernetes
- pkg: k8s.io/api/(\w+)/(v[\w\d]+)
alias: $1$2
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
alias: metav1
- pkg: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1
alias: apiextensionsv1
- pkg: k8s.io/apimachinery/pkg/api/errors
alias: apierrors
- pkg: k8s.io/apimachinery/pkg/util/errors
alias: kerrors
# Controller Runtime
- pkg: sigs.k8s.io/controller-runtime/pkg/client
alias: ctrlruntimeclient
# Misc
- pkg: github.com/kubermatic/machine-controller/pkg/apis/cluster/v1alpha1
alias: clusterv1alpha1
- pkg: github.com/Masterminds/semver/v3
alias: semverlib