From 63abdf940f9506fd84f77e6af350cb70f664655e Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Wed, 19 Oct 2022 11:34:24 +0200 Subject: [PATCH] Bump golangci-lint to 1.50.0 Changes since 1.47.3: * https://github.com/golangci/golangci-lint/releases/tag/v1.48.0 * https://github.com/golangci/golangci-lint/releases/tag/v1.49.0 * https://github.com/golangci/golangci-lint/releases/tag/v1.50.0 varcheck, deadcode, and structcheck are deprecated since 1.49.0. Signed-off-by: Stephen Kitt --- .golangci.yml | 11 ++++++++--- package/Dockerfile.shipyard-dapper-base | 2 +- test/e2e/framework/clusterglobalegressip.go | 2 +- test/e2e/framework/docker.go | 2 +- test/e2e/framework/framework.go | 4 ++-- test/e2e/framework/gateways.go | 6 +++--- test/e2e/framework/globalingressips.go | 2 +- 7 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 001fbb3e5..d1fc14954 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -27,7 +27,6 @@ linters: - bodyclose - contextcheck # - cyclop # This is equivalent to gocyclo - - deadcode - depguard - dogsled - dupl @@ -90,7 +89,6 @@ linters: # - scopelint # Deprecated since v1.39.0 # - sqlclosecheck # We don't use SQL - staticcheck - - structcheck - stylecheck # - tagliatelle # Inconsistent with stylecheck and not as good # - tenv # Not relevant for our Ginkgo UTs @@ -101,7 +99,6 @@ linters: - unconvert - unparam - unused - - varcheck # - varnamelen # It doesn't seem necessary to enforce a minimum variable name length - wastedassign - whitespace @@ -142,3 +139,11 @@ issues: - gochecknoinits - goerr113 - wrapcheck + + # Ignore complaints about the URL to the Apache license + - path: test/e2e/e2e_test.go + linters: + - gci + - gofmt + - gofumpt + - goimports diff --git a/package/Dockerfile.shipyard-dapper-base b/package/Dockerfile.shipyard-dapper-base index 1fcbc431f..7c9356395 100644 --- a/package/Dockerfile.shipyard-dapper-base +++ b/package/Dockerfile.shipyard-dapper-base @@ -56,7 +56,7 @@ RUN dnf -y install --nodocs --setopt=install_weak_deps=False \ find /usr/bin /usr/lib/golang /usr/libexec -type f -executable -newercc /proc -size +1M ! -name hyperkube \( -execdir upx ${UPX_LEVEL} {} \; -o -true \) && \ ln -f /usr/bin/kubectl /usr/bin/hyperkube -ENV LINT_VERSION=v1.47.3 \ +ENV LINT_VERSION=v1.50.0 \ HELM_VERSION=v3.9.0 \ KIND_VERSION=v0.15.0 \ BUILDX_VERSION=v0.8.2 \ diff --git a/test/e2e/framework/clusterglobalegressip.go b/test/e2e/framework/clusterglobalegressip.go index b5c9ac3e5..d2210d1ec 100644 --- a/test/e2e/framework/clusterglobalegressip.go +++ b/test/e2e/framework/clusterglobalegressip.go @@ -47,7 +47,7 @@ func AwaitAllocatedEgressIPs(client dynamic.ResourceInterface, name string) []st func() (interface{}, error) { resGip, err := client.Get(context.TODO(), name, metav1.GetOptions{}) if apierrors.IsNotFound(err) { - return nil, nil // nolint:nilnil // We want to repeat but let the checker known that nothing was found. + return nil, nil //nolint:nilnil // We want to repeat but let the checker known that nothing was found. } return resGip, err }, diff --git a/test/e2e/framework/docker.go b/test/e2e/framework/docker.go index 55c14454a..777cddf9c 100644 --- a/test/e2e/framework/docker.go +++ b/test/e2e/framework/docker.go @@ -98,7 +98,7 @@ func (d *Docker) RunCommandUntil(command ...string) (string, string) { stdout, stderr, cmdErr = d.runCommand(command...) if cmdErr != nil { Logf("Error attempting to run %v: %v", append([]string{}, command...), cmdErr) - return false, nil // nolint:nilerr // Returning nil value is intentional + return false, nil //nolint:nilerr // Returning nil value is intentional } return true, nil }) diff --git a/test/e2e/framework/framework.go b/test/e2e/framework/framework.go index ae0be970b..c20ae393a 100644 --- a/test/e2e/framework/framework.go +++ b/test/e2e/framework/framework.go @@ -245,7 +245,7 @@ func DetectGlobalnet() { AwaitUntil("find Clusters to detect if Globalnet is enabled", func() (interface{}, error) { clusters, err := clusters.List(context.TODO(), metav1.ListOptions{}) if apierrors.IsNotFound(err) { - return nil, nil // nolint:nilnil // We want to repeat but let the checker known that nothing was found. + return nil, nil //nolint:nilnil // We want to repeat but let the checker known that nothing was found. } return clusters, err }, func(result interface{}) (bool, string, error) { @@ -299,7 +299,7 @@ func fetchClusterIDs() { daemonSet := AwaitUntil(fmt.Sprintf("find %s DaemonSet for %q", name, TestContext.ClusterIDs[i]), func() (interface{}, error) { ds, err := KubeClients[i].AppsV1().DaemonSets(TestContext.SubmarinerNamespace).Get(context.TODO(), name, metav1.GetOptions{}) if apierrors.IsNotFound(err) { - return nil, nil // nolint:nilnil // We want to repeat but let the checker known that nothing was found. + return nil, nil //nolint:nilnil // We want to repeat but let the checker known that nothing was found. } return ds, err diff --git a/test/e2e/framework/gateways.go b/test/e2e/framework/gateways.go index 8b6635ce2..16c2392e6 100644 --- a/test/e2e/framework/gateways.go +++ b/test/e2e/framework/gateways.go @@ -45,7 +45,7 @@ func (f *Framework) AwaitGatewayWithStatus(cluster ClusterIndex, name, status st func() (interface{}, error) { resGw, err := gwClient.Get(context.TODO(), name, metav1.GetOptions{}) if apierrors.IsNotFound(err) { - return nil, nil // nolint:nilnil // We want to repeat but let the checker known that nothing was found. + return nil, nil //nolint:nilnil // We want to repeat but let the checker known that nothing was found. } return resGw, err }, @@ -112,7 +112,7 @@ func (f *Framework) AwaitGatewayFullyConnected(cluster ClusterIndex, name string func() (interface{}, error) { resGw, err := gwClient.Get(context.TODO(), name, metav1.GetOptions{}) if apierrors.IsNotFound(err) { - return nil, nil // nolint:nilnil // We want to repeat but let the checker known that nothing was found. + return nil, nil //nolint:nilnil // We want to repeat but let the checker known that nothing was found. } return resGw, err }, @@ -177,7 +177,7 @@ func (f *Framework) DeleteGateway(cluster ClusterIndex, name string) { AwaitUntil("delete gateway", func() (interface{}, error) { err := gatewayClient(cluster).Delete(context.TODO(), name, metav1.DeleteOptions{}) if apierrors.IsNotFound(err) { - return nil, nil // nolint:nilnil // We want to repeat but let the checker known that nothing was found. + return nil, nil //nolint:nilnil // We want to repeat but let the checker known that nothing was found. } return nil, err }, NoopCheckResult) diff --git a/test/e2e/framework/globalingressips.go b/test/e2e/framework/globalingressips.go index ded007e05..7dbfe8ec7 100644 --- a/test/e2e/framework/globalingressips.go +++ b/test/e2e/framework/globalingressips.go @@ -42,7 +42,7 @@ func (f *Framework) AwaitGlobalIngressIP(cluster ClusterIndex, name, namespace s func() (interface{}, error) { resGip, err := gipClient.Get(context.TODO(), name, metav1.GetOptions{}) if apierrors.IsNotFound(err) { - return nil, nil // nolint:nilnil // We want to repeat but let the checker known that nothing was found. + return nil, nil //nolint:nilnil // We want to repeat but let the checker known that nothing was found. } return resGip, err },