-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'kubernetes-sigs:main' into external-cloud-provider
- Loading branch information
Showing
74 changed files
with
1,288 additions
and
793 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 |
---|---|---|
@@ -1,16 +1,209 @@ | ||
linters: | ||
disable-all: true | ||
enable: | ||
- asciicheck | ||
- bodyclose | ||
- deadcode | ||
- depguard | ||
- dogsled | ||
- errcheck | ||
- exportloopref | ||
- gci | ||
- goconst | ||
- gocritic | ||
- godot | ||
- gofmt | ||
- goimports | ||
- goprintffuncname | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ifshort | ||
- importas | ||
- ineffassign | ||
- misspell | ||
- nakedret | ||
- nilerr | ||
- noctx | ||
- nolintlint | ||
- prealloc | ||
- predeclared | ||
- revive | ||
- rowserrcheck | ||
- staticcheck | ||
- structcheck | ||
- stylecheck | ||
- thelper | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
- varcheck | ||
- whitespace | ||
|
||
linters-settings: | ||
godot: | ||
# declarations - for top level declaration comments (default); | ||
# toplevel - for top level comments; | ||
# all - for all comments. | ||
scope: toplevel | ||
exclude: | ||
- '^ \+.*' | ||
- '^ ANCHOR.*' | ||
ifshort: | ||
# Maximum length of variable declaration measured in number of characters, after which linter won't suggest using short syntax. | ||
max-decl-chars: 50 | ||
gci: | ||
local-prefixes: "sigs.k8s.io/cluster-api-provider-ibmcloud" | ||
importas: | ||
no-unaliased: true | ||
alias: | ||
# Kubernetes | ||
- pkg: k8s.io/api/core/v1 | ||
alias: corev1 | ||
- pkg: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 | ||
alias: apiextensionsv1 | ||
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1 | ||
alias: metav1 | ||
- 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 | ||
alias: ctrl | ||
# CAPI | ||
- pkg: sigs.k8s.io/cluster-api/api/v1alpha3 | ||
alias: capiv1alpha3 | ||
- pkg: sigs.k8s.io/cluster-api/api/v1alpha4 | ||
alias: capiv1alpha4 | ||
- pkg: sigs.k8s.io/cluster-api/api/v1beta1 | ||
alias: capiv1beta1 | ||
# CAPI-IBMCLOUD | ||
- pkg: sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1alpha3 | ||
alias: infrav1alpha3 | ||
- pkg: sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1alpha4 | ||
alias: infrav1alpha4 | ||
- pkg: sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1 | ||
alias: infrav1beta1 | ||
nolintlint: | ||
allow-unused: false | ||
allow-leading-space: false | ||
require-specific: true | ||
staticcheck: | ||
go: "1.17" | ||
stylecheck: | ||
go: "1.17" | ||
gosec: | ||
excludes: | ||
- G307 # Deferring unsafe method "Close" on type "\*os.File" | ||
- G108 # Profiling endpoint is automatically exposed on /debug/pprof | ||
gocritic: | ||
enabled-tags: | ||
- experimental | ||
disabled-checks: | ||
- appendAssign | ||
- dupImport # https://github.com/go-critic/go-critic/issues/845 | ||
- evalOrder | ||
- ifElseChain | ||
- octalLiteral | ||
- regexpSimplify | ||
- sloppyReassign | ||
- truncateCmp | ||
- typeDefFirst | ||
- unnamedResult | ||
- unnecessaryDefer | ||
- whyNoLint | ||
- wrapperFunc | ||
unused: | ||
go: "1.17" | ||
issues: | ||
max-same-issues: 0 | ||
max-issues-per-linter: 0 | ||
# We are disabling default golangci exclusions because we want to help reviewers to focus on reviewing the most relevant | ||
# changes in PRs and avoid nitpicking. | ||
exclude-use-default: false | ||
exclude-rules: | ||
- linters: | ||
- gci | ||
path: _test\.go | ||
- linters: | ||
- revive | ||
text: "exported: exported method .*\\.(Reconcile|SetupWithManager|SetupWebhookWithManager) should have comment or be unexported" | ||
- linters: | ||
- errcheck | ||
text: Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked | ||
# Exclude some packages or code to require comments, for example test code, or fake clients. | ||
- linters: | ||
- revive | ||
text: exported (method|function|type|const) (.+) should have comment or be unexported | ||
source: (func|type).*Fake.* | ||
- linters: | ||
- revive | ||
text: exported (method|function|type|const) (.+) should have comment or be unexported | ||
path: fake_\.go | ||
- linters: | ||
- revive | ||
text: exported (method|function|type|const) (.+) should have comment or be unexported | ||
path: "(framework|e2e)/.*.go" | ||
# Disable unparam "always receives" which might not be really | ||
# useful when building libraries. | ||
- linters: | ||
- unparam | ||
text: always receives | ||
# Dot imports for gomega or ginkgo are allowed | ||
# within test files. | ||
- path: _test\.go | ||
text: should not use dot imports | ||
- path: (framework|e2e)/.*.go | ||
text: should not use dot imports | ||
- path: _test\.go | ||
text: cyclomatic complexity | ||
# Append should be able to assign to a different var/slice. | ||
- linters: | ||
- gocritic | ||
text: "appendAssign: append result not assigned to the same slice" | ||
# Disable linters for conversion | ||
- linters: | ||
- staticcheck | ||
text: "SA1019: in.(.+) is deprecated" | ||
path: .*(api|types)\/.*\/.*conversion.*\.go$ | ||
- linters: | ||
- revive | ||
text: exported (method|function|type|const) (.+) should have comment or be unexported | ||
path: .*(api|types)\/.*\/.*conversion.*\.go$ | ||
- linters: | ||
- revive | ||
text: "var-naming: don't use underscores in Go names;" | ||
path: .*(api|types)\/.*\/.*conversion.*\.go$ | ||
- linters: | ||
- revive | ||
text: "receiver-naming: receiver name" | ||
path: .*(api|types)\/.*\/.*conversion.*\.go$ | ||
- linters: | ||
- stylecheck | ||
text: "ST1003: should not use underscores in Go names;" | ||
path: .*(api|types)\/.*\/.*conversion.*\.go$ | ||
- linters: | ||
- stylecheck | ||
text: "ST1016: methods on the same type should have the same receiver name" | ||
path: .*(api|types)\/.*\/.*conversion.*\.go$ | ||
# hack/tools | ||
- linters: | ||
- typecheck | ||
text: import (".+") is a program, not an importable package | ||
path: ^tools\.go$ | ||
# We don't care about defer in for loops in test files. | ||
- linters: | ||
- gocritic | ||
text: "deferInLoop: Possible resource leak, 'defer' is called in the 'for' loop" | ||
path: _test\.go | ||
|
||
run: | ||
timeout: 10m | ||
build-tags: | ||
- tools | ||
- e2e | ||
skip-files: | ||
- "zz_generated.*\\.go$" | ||
allow-parallel-runners: true |
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
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
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.