Skip to content

Dump of new version of linter #5144

@sxd

Description

@sxd

Welcome

  • Yes, I'm using a binary release within 2 latest releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've read the typecheck section of the FAQ.
  • Yes, I've tried with the standalone linter if available (e.g., gocritic, go vet, etc.).
  • I agree to follow this project's Code of Conduct

Description of the problem

There was a new releaster of ginkgolinter before the release of 1.62.0 that contains two bugs fixed (nunnatsa/ginkgolinter#174 nunnatsa/ginkgolinter#173) that were include into the linter after 1.62.0 was released.

It is possible to have a new release that bumps these update?

Version of golangci-lint

$ golangci-lint --version
golangci-lint has version 1.62.0 built with go1.23.2 from 22b58c9b on 2024-11-10T19:09:02Z

Configuration

# paste configuration file or CLI flags here

Go environment

$ go version && go env
go version go1.23.3 linux/amd64
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/***/.cache/go-build'
GOENV='/home/***/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/***/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/***/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.23.3'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/***/.config/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/***/src/cloudnative-pg/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1749669362=/tmp/go-build -gno-record-gcc-switches'

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
INFO golangci-lint has version 1.62.0 built with go1.23.2 from 22b58c9b on 2024-11-10T19:09:02Z 
INFO [config_reader] Config search paths: [./ /home/zeus/src/cloudnative-pg /home/zeus/src /home/zeus /home /] 
INFO [config_reader] Used config file .golangci.yml 
INFO [lintersdb] Active 44 linters: [asciicheck bodyclose copyloopvar dogsled dupl durationcheck errcheck gci ginkgolinter gocognit goconst gocritic gocyclo gofmt gofumpt goheader goimports gomoddirectives gomodguard goprintffuncname gosec gosimple govet importas ineffassign lll makezero misspell nakedret nestif prealloc predeclared revive rowserrcheck sqlclosecheck staticcheck stylecheck thelper tparallel unconvert unparam unused wastedassign whitespace] 
INFO [loader] Go packages loading at mode 8767 (deps|imports|types_sizes|compiled_files|exports_file|files|name) took 15.399251769s 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 82.385845ms 
INFO [linters_context] importas settings found, but no aliases listed. List aliases under alias: key. 
INFO [linters_context/goanalysis] analyzers took 19m33.95491205s with top 10 stages: buildir: 10m14.321659144s, wastedassign: 1m39.022587878s, goimports: 59.253958902s, unparam: 52.436133727s, the_only_name: 44.598512964s, nilness: 25.23087618s, dupl: 23.08751584s, gosec: 16.611383033s, gofumpt: 15.453589338s, unconvert: 12.76909718s 
INFO [runner] Issues before processing: 689, after processing: 28 
INFO [runner] Processors filtering stat (in/out): autogenerated_exclude: 683/683, exclude-rules: 683/92, nolint: 92/28, fixer: 28/28, cgo: 689/689, skip_dirs: 683/683, identifier_marker: 683/683, max_per_file_from_linter: 28/28, max_from_linter: 28/28, path_shortener: 28/28, sort_results: 28/28, filename_unadjuster: 689/689, invalid_issue: 689/689, uniq_by_line: 28/28, max_same_issues: 28/28, source_code: 28/28, path_prefixer: 28/28, path_prettifier: 689/689, skip_files: 689/683, exclude: 683/683, diff: 28/28, severity-rules: 28/28 
INFO [runner] processing took 86.912768ms with stages: nolint: 46.319703ms, identifier_marker: 12.56916ms, autogenerated_exclude: 10.846462ms, exclude-rules: 9.414326ms, path_prettifier: 6.153367ms, skip_dirs: 1.175163ms, skip_files: 132.259µs, cgo: 103.642µs, invalid_issue: 86.307µs, filename_unadjuster: 35.105µs, source_code: 30.456µs, max_same_issues: 18.324µs, uniq_by_line: 12.797µs, path_shortener: 7.671µs, max_from_linter: 2.841µs, max_per_file_from_linter: 2.375µs, fixer: 892ns, exclude: 880ns, diff: 351ns, sort_results: 347ns, path_prefixer: 173ns, severity-rules: 167ns 
INFO [runner] linters took 1m7.217320128s with stages: goanalysis_metalinter: 1m7.130243816s 
pkg/reconciler/persistentvolumeclaim/calculator_test.go:101:3: ginkgo-linter: asserting a non-error type with HaveOccurred matcher (ginkgolinter)
		Expect(role.GetSource(&StorageSource{})).Error().Should(HaveOccurred())
		^
pkg/reconciler/persistentvolumeclaim/calculator_test.go:154:3: ginkgo-linter: asserting a non-error type with HaveOccurred matcher (ginkgolinter)
		Expect(role.GetSource(&storageSource2)).Error().Should(HaveOccurred())
		^
tests/e2e/asserts_test.go:916:3: ginkgo-linter: wrong error assertion. Consider using `Eventually(func() error {
	primaryReplicaCluster, err = env.GetClusterPrimary(namespace, replicaClusterName)
	return err
}, 30, 3).Should(Succeed())` instead (ginkgolinter)
		Eventually(func() error {
		^
tests/e2e/asserts_test.go:1699:3: ginkgo-linter: wrong error assertion. Consider using `Eventually(func() error {
	cmd := fmt.Sprintf("kubectl patch ScheduledBackup %v -n %v -p '{\"spec\":{\"suspend\":true}}' "+
		"--type='merge'", scheduledBackupName, namespace)
	_, _, err = testsUtils.RunUnchecked(cmd)
	if err != nil {
		return err
	}
	return nil
}, 60, 5).Should(Succeed())` instead (ginkgolinter)
		Eventually(func() error {
		^
tests/e2e/asserts_test.go:1747:3: ginkgo-linter: wrong error assertion. Consider using `Eventually(func() error {
	cmd := fmt.Sprintf("kubectl patch ScheduledBackup %v -n %v -p '{\"spec\":{\"suspend\":false}}' "+
		"--type='merge'", scheduledBackupName, namespace)
	_, _, err = testsUtils.RunUnchecked(cmd)
	if err != nil {
		return err
	}
	return nil
}, 60, 5).Should(Succeed())` instead (ginkgolinter)
		Eventually(func() error {
		^
tests/e2e/asserts_test.go:2203:4: ginkgo-linter: wrong error assertion. Consider using `Eventually(func() error {
	_, _, err := testsUtils.RunUnchecked(cmd)
	return err
}, 60, 5).Should(Succeed())` instead (ginkgolinter)
			Eventually(func() error {
			^
tests/e2e/asserts_test.go:2259:4: ginkgo-linter: wrong error assertion. Consider using `Eventually(func() error {
	_, _, err := testsUtils.RunUnchecked(cmd)
	return err
}, 60, 5).Should(Succeed())` instead (ginkgolinter)
			Eventually(func() error {
			^
tests/e2e/asserts_test.go:2485:2: ginkgo-linter: wrong error assertion. Consider using `Eventually(func() error {
	return CreateResourcesFromFileWithError(namespace, sampleFilePath)
}, RetryTimeout, PollingTime).Should(Succeed())` instead (ginkgolinter)
	Eventually(func() error {
	^
tests/e2e/certificates_test.go:128:4: ginkgo-linter: wrong error assertion. Consider using `Eventually(func() error {
	_, _, err = utils.RunUnchecked(fmt.Sprintf(
		"kubectl patch cluster %v -n %v -p "+
			"'{\"spec\":{\"certificates\":{\"serverCASecret\":\"%v\","+
			"\"serverTLSSecret\":\"%v\"}}}'"+
			" --type='merge'", clusterName, namespace, serverCASecretName, serverCertSecretName))
	if err != nil {
		return err
	}
	return nil
}, 60, 5).Should(Succeed())` instead (ginkgolinter)
			Eventually(func() error {
			^
tests/e2e/certificates_test.go:169:4: ginkgo-linter: wrong error assertion. Consider using `Eventually(func() error {
	_, _, err := utils.RunUnchecked(fmt.Sprintf(
		"kubectl patch cluster %v -n %v -p "+
			"'{\"spec\":{\"certificates\":{\"clientCASecret\":\"%v\","+
			"\"replicationTLSSecret\":\"%v\"}}}'"+
			" --type='merge'", clusterName, namespace, clientCASecretName, replicaCertSecretName))
	if err != nil {
		return err
	}
	return nil
}, 60, 5).Should(Succeed())` instead (ginkgolinter)
			Eventually(func() error {
			^
tests/e2e/certificates_test.go:197:5: ginkgo-linter: wrong error assertion. Consider using `Eventually(func() error {
	_, _, err := utils.RunUnchecked(fmt.Sprintf(
		"kubectl patch cluster %v -n %v -p "+
			"'{\"spec\":{\"certificates\":{\"serverCASecret\":\"%v\","+
			"\"serverTLSSecret\":\"%v\",\"clientCASecret\":\"%v\","+
			"\"replicationTLSSecret\":\"%v\"}}}'"+
			" --type='merge'",
		clusterName,
		namespace,
		serverCASecretName,
		serverCertSecretName,
		clientCASecretName,
		replicaCertSecretName,
	))
	if err != nil {
		return err
	}
	return nil
}, 60, 5).Should(Succeed())` instead (ginkgolinter)
				Eventually(func() error {
				^
tests/e2e/logs_test.go:84:5: ginkgo-linter: wrong error assertion. Consider using `Eventually(func(_ Gomega) error {
	_, _, queryError = utils.ExecCommand(env.Ctx, env.Interface, env.RestClientConfig, pod,
		specs.PostgresContainerName, &commandTimeout, "psql", "-U", "postgres", "app", "-tAc",
		errorTestQuery)
	return queryError
}, RetryTimeout, PollingTime).ShouldNot(Succeed())` instead (ginkgolinter)
				Eventually(func(_ Gomega) error {
				^
tests/e2e/logs_test.go:116:4: ginkgo-linter: wrong error assertion. Consider using `Eventually(func() error {
	_, _, queryError = utils.ExecCommand(env.Ctx, env.Interface, env.RestClientConfig,
		*primaryPod, specs.PostgresContainerName,
		&commandTimeout, "psql", "-U", "postgres", "app", "-tAc", errorTestQuery)
	return queryError
}, RetryTimeout, PollingTime).ShouldNot(Succeed())` instead (ginkgolinter)
			Eventually(func() error {
			^
tests/e2e/managed_services_test.go:80:4: ginkgo-linter: wrong error assertion. Consider using `Eventually(func(g Gomega) error {
	cluster, err := env.GetCluster(namespace, clusterName)
	g.Expect(err).ToNot(HaveOccurred())
	cluster.Spec.Managed.Services.Additional = []apiv1.ManagedService{}
	return env.Client.Update(ctx, cluster)
}, RetryTimeout, PollingTime).Should(Succeed())` instead (ginkgolinter)
			Eventually(func(g Gomega) error {
			^
tests/e2e/managed_services_test.go:126:4: ginkgo-linter: wrong error assertion. Consider using `Eventually(func(g Gomega) error {
	cluster, err := env.GetCluster(namespace, clusterName)
	g.Expect(err).ToNot(HaveOccurred())
	cluster.Spec.Managed.Services.DisabledDefaultServices = []apiv1.ServiceSelectorType{}
	return env.Client.Update(ctx, cluster)
}, RetryTimeout, PollingTime).Should(Succeed())` instead (ginkgolinter)
			Eventually(func(g Gomega) error {
			^
tests/e2e/managed_services_test.go:187:4: ginkgo-linter: wrong error assertion. Consider using `Eventually(func(g Gomega) error {
	cluster, err := env.GetCluster(namespace, clusterName)
	g.Expect(err).ToNot(HaveOccurred())
	cluster.Spec.Managed.Services.Additional[0].ServiceTemplate.ObjectMeta.Labels["new-label"] = "new"
	return env.Client.Update(ctx, cluster)
}, RetryTimeout, PollingTime).Should(Succeed())` instead (ginkgolinter)
			Eventually(func(g Gomega) error {
			^
tests/e2e/replica_mode_cluster_test.go:188:5: ginkgo-linter: wrong error assertion. Consider using `Eventually(func() error {
	clusterOnePrimary, err = env.GetClusterPrimary(namespace, clusterOneName)
	return err
}, 30, 3).Should(Succeed())` instead (ginkgolinter)
				Eventually(func() error {
				^
tests/e2e/replica_mode_cluster_test.go:206:5: ginkgo-linter: wrong error assertion. Consider using `Eventually(func() error {
	clusterTwoPrimary, err = env.GetClusterPrimary(namespace, clusterTwoName)
	return err
}, 30, 3).Should(Succeed())` instead (ginkgolinter)
				Eventually(func() error {
				^
tests/e2e/rolling_update_test.go:114:3: ginkgo-linter: wrong error assertion. Consider using `Eventually(func(g Gomega) error {
	var err error
	cluster, err = env.GetCluster(namespace, clusterName)
	g.Expect(err).ToNot(HaveOccurred())

	cluster.Spec.ImageName = updatedImageName
	return env.Client.Update(env.Ctx, cluster)
}, RetryTimeout, PollingTime).Should(Succeed())` instead (ginkgolinter)
		Eventually(func(g Gomega) error {
		^
tests/e2e/rolling_update_test.go:600:5: ginkgo-linter: The second parameter of MatchError must be the function description (string) (ginkgolinter)
				Eventually(func() error {
				^
tests/e2e/storage_expansion_test.go:94:5: ginkgo-linter: wrong error assertion. Consider using `Eventually(func() error {
	_, _, err = utils.RunUnchecked("kubectl patch cluster " + clusterName + " -n " + namespace +
		" -p '{\"spec\":{\"storage\":{\"resizeInUseVolumes\":false}}}' --type=merge")
	if err != nil {
		return err
	}
	return nil
}, 60, 5).Should(Succeed())` instead (ginkgolinter)
				Eventually(func() error {
				^
tests/e2e/syncreplicas_test.go:106:5: ginkgo-linter: wrong error assertion. Consider using `Eventually(func(g Gomega) error {
	cluster, err := env.GetCluster(namespace, clusterName)
	g.Expect(err).ToNot(HaveOccurred())

	cluster.Spec.MaxSyncReplicas = 1
	return env.Client.Update(env.Ctx, cluster)
}, RetryTimeout, 5).Should(Succeed())` instead (ginkgolinter)
				Eventually(func(g Gomega) error {
				^
tests/e2e/syncreplicas_test.go:197:5: ginkgo-linter: wrong error assertion. Consider using `Eventually(func(g Gomega) error {
	cluster, err := env.GetCluster(namespace, clusterName)
	g.Expect(err).ToNot(HaveOccurred())
	cluster.Spec.PostgresConfiguration.Synchronous.MaxStandbyNamesFromCluster = ptr.To(1)
	cluster.Spec.PostgresConfiguration.Synchronous.Number = 1
	return env.Client.Update(env.Ctx, cluster)
}, RetryTimeout, 5).Should(Succeed())` instead (ginkgolinter)
				Eventually(func(g Gomega) error {
				^
tests/e2e/syncreplicas_test.go:210:5: ginkgo-linter: wrong error assertion. Consider using `Eventually(func(g Gomega) error {
	cluster, err := env.GetCluster(namespace, clusterName)
	g.Expect(err).ToNot(HaveOccurred())
	cluster.Spec.PostgresConfiguration.Synchronous.Method = apiv1.SynchronousReplicaConfigurationMethodFirst
	return env.Client.Update(env.Ctx, cluster)
}, RetryTimeout, 5).Should(Succeed())` instead (ginkgolinter)
				Eventually(func(g Gomega) error {
				^
tests/e2e/syncreplicas_test.go:222:5: ginkgo-linter: wrong error assertion. Consider using `Eventually(func(g Gomega) error {
	cluster, err := env.GetCluster(namespace, clusterName)
	g.Expect(err).ToNot(HaveOccurred())
	cluster.Spec.PostgresConfiguration.Synchronous.MaxStandbyNamesFromCluster = nil
	cluster.Spec.PostgresConfiguration.Synchronous.StandbyNamesPre = []string{"preSyncReplica"}
	cluster.Spec.PostgresConfiguration.Synchronous.StandbyNamesPost = []string{"postSyncReplica"}
	return env.Client.Update(env.Ctx, cluster)
}, RetryTimeout, 5).Should(Succeed())` instead (ginkgolinter)
				Eventually(func(g Gomega) error {
				^
tests/utils/backup.go:43:2: ginkgo-linter: wrong error assertion. Consider using `Eventually(func() error {
	_, stderr, err := RunUnchecked("kubectl apply -n " + namespace + " -f " + backupFile)
	if err != nil {
		return fmt.Errorf("could not create backup.\nStdErr: %v\nError: %v", stderr, err)
	}
	return nil
}, RetryTimeout, PollingTime).Should(Succeed())` instead (ginkgolinter)
	Eventually(func() error {
	^
tests/utils/environment.go:182:2: ginkgo-linter: wrong error assertion. Consider using `Eventually(func() error {
	stdOut, stdErr, err = utils.ExecCommand(ctx, env.Interface, env.RestClientConfig,
		pod, containerName, timeout, command...)
	if err != nil {
		return err
	}
	return nil
}, RetryTimeout, PollingTime).Should(Succeed())` instead (ginkgolinter)
	Eventually(func() error {
	^
tests/utils/pod.go:263:2: ginkgo-linter: wrong error assertion. Consider using `Eventually(func() error {
	stdOut, stdErr, err = env.ExecQueryInInstancePod(
		PodLocator{
			Namespace:	podLocator.Namespace,
			PodName:	podLocator.PodName,
		}, dbname, query)
	if err != nil {
		return err
	}
	return nil
}, retryTimeout, pollingTime).Should(Succeed())` instead (ginkgolinter)
	Eventually(func() error {
	^
INFO File cache stats: 1039 entries of total size 6.2MiB 
INFO Memory: 721 samples, avg is 2801.7MB, max is 5311.2MB 
INFO Execution took 1m22.711820791s               

A minimal reproducible example or link to a public repository

// add your code here

Validation

  • Yes, I've included all information above (version, config, etc.).

Supporter

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions