From ae84be222d988ee61cdb99b62a10908e5fe7f2c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Drzewiecki?= Date: Tue, 20 Feb 2024 10:27:36 +0100 Subject: [PATCH 1/5] upgrades golangci-lint to v4 --- .github/workflows/golangci-lint.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index 766fca07..19ca4296 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -21,12 +21,12 @@ jobs: go-version: '1.21' cache: false - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 with: # Require: The version of golangci-lint to use. # When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version. # When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit. - version: v1.54.2 + version: v1.56.2 # Optional: working directory, useful for monorepos # working-directory: somedir From 960cb9b8d95d41fe6355341b6081a0bd7c3c6573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=27Disper=27=20Drzewiecki?= Date: Mon, 26 Feb 2024 12:16:33 +0100 Subject: [PATCH 2/5] Update golangci-lint.yaml 4.0.0 --- .github/workflows/golangci-lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index 19ca4296..b481ea27 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -21,7 +21,7 @@ jobs: go-version: '1.21' cache: false - name: golangci-lint - uses: golangci/golangci-lint-action@v4 + uses: golangci/golangci-lint-action@v4.0.0 with: # Require: The version of golangci-lint to use. # When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version. From 108228c275901bb9c3f40820aec4b783ee1023d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Drzewiecki?= Date: Mon, 26 Feb 2024 12:24:49 +0100 Subject: [PATCH 3/5] linter --- internal/controller/find_last_sync_time_test.go | 4 ++-- internal/controller/gardener_cluster_controller_test.go | 4 ++-- internal/controller/next_requeue_test.go | 4 ++-- internal/controller/suite_test.go | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/controller/find_last_sync_time_test.go b/internal/controller/find_last_sync_time_test.go index 60c7af33..9d41e0c8 100644 --- a/internal/controller/find_last_sync_time_test.go +++ b/internal/controller/find_last_sync_time_test.go @@ -3,8 +3,8 @@ package controller import ( "time" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" + . "github.com/onsi/ginkgo/v2" //nolint:revive + . "github.com/onsi/gomega" //nolint:revive ) var _ = Describe("findLastSyncTime", func() { diff --git a/internal/controller/gardener_cluster_controller_test.go b/internal/controller/gardener_cluster_controller_test.go index f60ae6fd..854fd91a 100644 --- a/internal/controller/gardener_cluster_controller_test.go +++ b/internal/controller/gardener_cluster_controller_test.go @@ -5,8 +5,8 @@ import ( "time" imv1 "github.com/kyma-project/infrastructure-manager/api/v1" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" + . "github.com/onsi/ginkgo/v2" //nolint:revive + . "github.com/onsi/gomega" //nolint:revive corev1 "k8s.io/api/core/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/internal/controller/next_requeue_test.go b/internal/controller/next_requeue_test.go index fc496db6..711db27d 100644 --- a/internal/controller/next_requeue_test.go +++ b/internal/controller/next_requeue_test.go @@ -3,8 +3,8 @@ package controller import ( "time" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" + . "github.com/onsi/ginkgo/v2" //nolint:revive + . "github.com/onsi/gomega" //nolint:revive ) var _ = Describe("nextRequeueAfter", func() { diff --git a/internal/controller/suite_test.go b/internal/controller/suite_test.go index d4c08cf4..087152e6 100644 --- a/internal/controller/suite_test.go +++ b/internal/controller/suite_test.go @@ -24,10 +24,10 @@ import ( infrastructuremanagerv1 "github.com/kyma-project/infrastructure-manager/api/v1" "github.com/kyma-project/infrastructure-manager/internal/controller/mocks" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" + . "github.com/onsi/ginkgo/v2" //nolint:revive + . "github.com/onsi/gomega" //nolint:revive "github.com/pkg/errors" - . "github.com/stretchr/testify/mock" + . "github.com/stretchr/testify/mock" //nolint:revive "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" ctrl "sigs.k8s.io/controller-runtime" @@ -46,7 +46,7 @@ var ( testEnv *envtest.Environment //nolint:gochecknoglobals suiteCtx context.Context //nolint:gochecknoglobals cancelSuiteCtx context.CancelFunc //nolint:gochecknoglobals - anyContext = MatchedBy(func(ctx context.Context) bool { return true }) + anyContext = MatchedBy(func(_ context.Context) bool { return true }) ) const TestKubeconfigValidityTime = 24 * time.Hour From 83cec25142d74c716b03300bbc1c1be2077a29ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Drzewiecki?= Date: Mon, 26 Feb 2024 12:27:57 +0100 Subject: [PATCH 4/5] linter --- internal/controller/suite_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/controller/suite_test.go b/internal/controller/suite_test.go index 087152e6..81f8a669 100644 --- a/internal/controller/suite_test.go +++ b/internal/controller/suite_test.go @@ -41,12 +41,12 @@ import ( // http://onsi.github.io/ginkgo/ to learn more about Ginkgo. var ( - cfg *rest.Config //nolint:gochecknoglobals - k8sClient client.Client //nolint:gochecknoglobals - testEnv *envtest.Environment //nolint:gochecknoglobals - suiteCtx context.Context //nolint:gochecknoglobals - cancelSuiteCtx context.CancelFunc //nolint:gochecknoglobals - anyContext = MatchedBy(func(_ context.Context) bool { return true }) + cfg *rest.Config //nolint:gochecknoglobals + k8sClient client.Client //nolint:gochecknoglobals + testEnv *envtest.Environment //nolint:gochecknoglobals + suiteCtx context.Context //nolint:gochecknoglobals + cancelSuiteCtx context.CancelFunc //nolint:gochecknoglobals + anyContext = MatchedBy(func(_ context.Context) bool { return true }) //nolint:gochecknoglobals ) const TestKubeconfigValidityTime = 24 * time.Hour From 783f5996f1dd694f8563fd31f91c4fb31f1bf61f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Drzewiecki?= Date: Tue, 27 Feb 2024 11:43:46 +0100 Subject: [PATCH 5/5] checkout upgraded to v4 and setup-go upgraded to v5 --- .github/workflows/golangci-lint.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index b481ea27..7d29bffa 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -15,8 +15,8 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version: '1.21' cache: false