generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
1,447 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,5 +42,4 @@ vendor/ | |
|
||
# Lint files | ||
lint-report.json | ||
.golangci.yaml | ||
.act |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,264 @@ | ||
linters: | ||
enable-all: true | ||
disable: | ||
- contextcheck # too many false positives | ||
- depguard # checks if package imports are whitelisted | ||
- exhaustruct # TODO enable and fix, use regex to exclude certain cases | ||
- nlreturn # too strict and mostly code is not more readable | ||
- sqlclosecheck # not needed for this project | ||
- wsl # too strict and mostly code is not more readable | ||
- execinquery # deprecated since 1.58.0 | ||
- exportloopref # deprecated since 1.60.2 | ||
- gomnd | ||
### disabled for now... will be enabled 1 by 1 | ||
- ginkgolinter | ||
- lll | ||
- dupl | ||
- ireturn | ||
- maintidx | ||
- prealloc | ||
- testpackage | ||
- wrapcheck | ||
- paralleltest | ||
- perfsprint | ||
- importas | ||
- varnamelen | ||
- tagliatelle | ||
- noctx | ||
- stylecheck | ||
- bodyclose | ||
- gochecknoglobals | ||
- errorlint | ||
- promlinter | ||
- funlen | ||
- forcetypeassert | ||
- gosec | ||
- gomoddirectives | ||
- gocognit | ||
- nestif | ||
- inamedparam | ||
- unparam | ||
- gocritic | ||
- err113 | ||
|
||
linters-settings: | ||
stylecheck: | ||
dot-import-whitelist: | ||
- github.com/onsi/ginkgo/v2 | ||
- github.com/onsi/gomega | ||
revive: | ||
enable-all-rules: false | ||
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/kyma-metrics-collector) # Imports with the specified prefix. | ||
- blank # Blank imports. | ||
- dot # Dot imports. | ||
custom-order: true | ||
skip-generated: true | ||
importas: | ||
no-unaliased: false | ||
no-extra-aliases: true | ||
## kubernetes APIs get the prefix `k`. As an example check `kcorev1` | ||
|
||
alias: | ||
- pkg: k8s.io/api/core/v1 | ||
alias: kcorev1 | ||
- pkg: k8s.io/api/apps/v1 | ||
alias: kappsv1 | ||
- pkg: k8s.io/api/rbac/v1 | ||
alias: krbacv1 | ||
- pkg: k8s.io/apimachinery/pkg/runtime/schema | ||
alias: kschema | ||
- pkg: k8s.io/apimachinery/pkg/labels | ||
alias: klabels | ||
- pkg: k8s.io/apimachinery/pkg/runtime | ||
alias: kruntime | ||
- pkg: k8s.io/apimachinery/pkg/types | ||
alias: ktypes | ||
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1/unstructured | ||
alias: kunstructured | ||
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1 | ||
alias: kmetav1 | ||
- pkg: github.com/kyma-project/eventing-manager/api/eventing/v1alpha2 | ||
alias: eventingv1alpha2 | ||
- pkg: github.com/kyma-project/eventing-manager/api/operator/v1alpha1 | ||
alias: operatorv1alpha1 | ||
- pkg: github.com/kyma-project/api-gateway/apis/gateway/v1beta1 | ||
alias: apigatewayv1beta1 | ||
- pkg: k8s.io/client-go/dynamic/fake | ||
alias: kdynamicfake | ||
- pkg: k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset | ||
alias: kapixclientset | ||
- pkg: k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake | ||
alias: kapixclientsetfake | ||
- pkg: k8s.io/apimachinery/pkg/api/errors | ||
alias: kerrors | ||
- pkg: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 | ||
alias: kapiextensionsv1 | ||
- pkg: github.com/kyma-project/eventing-manager/testing | ||
alias: eventingtesting | ||
- pkg: sigs.k8s.io/controller-runtime | ||
alias: kctrl | ||
- pkg: sigs.k8s.io/controller-runtime/pkg/log | ||
alias: kctrllog | ||
- pkg: sigs.k8s.io/controller-runtime/pkg/client | ||
alias: kctrlclient | ||
- pkg: k8s.io/api/autoscaling/v1 | ||
alias: kautoscalingv1 | ||
- pkg: k8s.io/api/autoscaling/v2 | ||
alias: kautoscalingv2 | ||
- pkg: k8s.io/api/admissionregistration/v1 | ||
alias: kadmissionregistrationv1 | ||
- pkg: github.com/cloudevents/sdk-go/v2 | ||
alias: cloudevents | ||
- pkg: github.com/cloudevents/sdk-go/protocol/nats/v2 | ||
alias: cenats | ||
- pkg: github.com/cloudevents/sdk-go/v2/binding | ||
alias: cebinding | ||
- pkg: github.com/cloudevents/sdk-go/v2/client | ||
alias: ceclient | ||
- pkg: github.com/cloudevents/sdk-go/v2/event | ||
alias: ceevent | ||
- pkg: github.com/cloudevents/sdk-go/v2/protocol | ||
alias: ceprotocol | ||
- pkg: github.com/cloudevents/sdk-go/v2/protocol/http | ||
alias: cehttp | ||
- pkg: github.com/kyma-project/eventing-manager/pkg/backend/(\w+)$ | ||
alias: backend$1 | ||
- pkg: github.com/kyma-project/eventing-manager/pkg/backend/(\w+)/(\w+)$ | ||
alias: backend$1$2 | ||
- pkg: github.com/kyma-project/eventing-manager/test/(\w+)$ | ||
alias: test$1 | ||
- pkg: github.com/kyma-project/eventing-manager/test/(\w+)/(\w+)$ | ||
alias: test$1$2 | ||
- pkg: istio.io/client-go/pkg/apis/security/v1beta1 | ||
alias: istiopkgsecurityv1beta1 | ||
- pkg: istio.io/api/(\w+)/(v\d+\w*\d*)$ | ||
alias: istio$1$2 | ||
- pkg: github.com/nats-io/nats-server/v2/(\w+)$ | ||
alias: natsio$1 | ||
- pkg: github.com/nats-io/nats.go | ||
alias: natsio | ||
- pkg: github.com/kyma-project/eventing-manager/internal/controller/(\w+)$ | ||
alias: controller$1 | ||
- pkg: github.com/kyma-project/kyma/common/logging/logger | ||
alias: kymalogger | ||
- pkg: github.com/kyma-project/nats-manager/api/v1alpha1 | ||
alias: natsv1alpha1 | ||
- pkg: github.com/kyma-project/nats-manager/testutils | ||
alias: natstestutils | ||
- pkg: github.com/kyma-project/eventing-manager/internal/connection/nats | ||
alias: natsconnection | ||
- pkg: github.com/kyma-project/eventing-manager/internal/connection/nats/errors | ||
alias: natsconnectionerrors | ||
- pkg: github.com/kyma-project/eventing-manager/internal/connection/nats/mocks | ||
alias: natsconnectionmocks | ||
- pkg: github.com/kyma-project/eventing-manager/internal/controller/eventing/subscription/(\w+)$ | ||
alias: subscriptioncontroller$1 | ||
- pkg: github.com/kyma-project/eventing-manager/internal/controller/operator/eventing | ||
alias: eventingcontroller | ||
- pkg: github.com/kyma-project/eventing-manager/internal/controller/operator/eventing/mocks | ||
alias: eventingcontrollermocks | ||
- pkg: github.com/kyma-project/eventing-manager/pkg/ems/api/events/client/mocks | ||
alias: emsclientmocks | ||
- pkg: github.com/kyma-project/eventing-manager/pkg/ems/api/events/types | ||
alias: emstypes | ||
- pkg: github.com/onsi/gomega/types | ||
alias: gomegatypes | ||
- pkg: k8s.io/apimachinery/pkg/util/runtime | ||
alias: kutilruntime | ||
- pkg: k8s.io/client-go/kubernetes/scheme | ||
alias: kkubernetesscheme | ||
- pkg: github.com/kyma-project/eventing-manager/pkg/subscriptionmanager/manager | ||
alias: submgrmanager | ||
- pkg: github.com/kyma-project/eventing-manager/pkg/subscriptionmanager/manager/mocks | ||
alias: submgrmanagermocks | ||
- pkg: github.com/kyma-project/eventing-manager/pkg/subscriptionmanager/mocks | ||
alias: submgrmocks | ||
- pkg: github.com/kyma-project/eventing-manager/pkg/watcher/mocks | ||
alias: watchermocks | ||
- pkg: github.com/kyma-project/eventing-manager/pkg/k8s/mocks | ||
alias: k8smocks | ||
- pkg: github.com/kyma-project/eventing-manager/pkg/eventing/mocks | ||
alias: eventingmocks | ||
- pkg: github.com/kyma-project/eventing-manager/pkg/errors | ||
alias: emerrors | ||
- pkg: github.com/pkg/errors | ||
alias: pkgerrors | ||
- pkg: github.com/kyma-project/eventing-manager/testing/eventmeshsub | ||
alias: eventmeshsubmatchers | ||
|
||
ireturn: | ||
allow: | ||
- anon | ||
- error | ||
- empty | ||
- stdlib | ||
- Client | ||
- client.Object | ||
- (or|er)$ | ||
wrapcheck: | ||
ignorePackageGlobs: | ||
varnamelen: | ||
ignore-names: | ||
- ok # Ignore "ok" variables as return values of functions | ||
- g # Ignore "g" as it is commonly used for gomega | ||
- a # Ignore as it is used in comparison functions | ||
- b # Ignore as it is used in comparison functions | ||
- tc # Ignore as it is commonly used in table tests | ||
# Ignore "ok" variables that hold the bool return value of a type assertion. (defaults to false) | ||
ignore-type-assert-ok: true | ||
# Ignore "ok" variables that hold the bool return value of a map index. (defaults to false) | ||
ignore-map-index-ok: true | ||
# Ignore "ok" variables that hold the bool return value of a channel receive. (defaults to false) | ||
ignore-chan-recv-ok: true | ||
ignore-decls: | ||
- i int | ||
- g *gomega.WithT | ||
- w http.ResponseWriter | ||
- r *http.Request | ||
- cm *v1.ConfigMap | ||
- cm *kcorev1.ConfigMap | ||
- js JetStream | ||
- js *JetStream | ||
issues: | ||
exclude-rules: | ||
- path: "_test\\.go" | ||
linters: | ||
- wrapcheck | ||
- gochecknoglobals | ||
- 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: | ||
- importas | ||
text: has alias "" which is not part of config # Ignore false positives that emerged due to https://github.com/julz/importas/issues/15. | ||
- linters: | ||
- lll | ||
source: "^// +kubebuilder: " # Exclude lll issues for long lines starting with kubebuilder marker prefix | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
output: | ||
sort-results: true | ||
run: | ||
timeout: 15m | ||
exclude-files: | ||
- zz_generated.deepcopy.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.