From 6e656bf51a7daccfadc8aa38ce80ebc77c553252 Mon Sep 17 00:00:00 2001 From: Camila Macedo Date: Thu, 29 Aug 2024 19:35:40 +0100 Subject: [PATCH] (go/v4): remove the typecheck due the false positives The typecheck start to complain against many case scenarios. It might be a bug in the current version. So, we are removing it and we can revisit this decision in the future --- .github/workflows/lint-sample.yml | 53 ++++++------------- .../testdata/project/.golangci.yml | 1 - .../testdata/project/.golangci.yml | 1 - .../scaffolds/internal/templates/golangci.go | 1 - .../.golangci.yml | 1 - testdata/project-v4-multigroup/.golangci.yml | 1 - .../.golangci.yml | 1 - .../project-v4-with-grafana/.golangci.yml | 1 - testdata/project-v4/.golangci.yml | 1 - 9 files changed, 16 insertions(+), 45 deletions(-) diff --git a/.github/workflows/lint-sample.yml b/.github/workflows/lint-sample.yml index ea123013fc0..20e343ba97b 100644 --- a/.github/workflows/lint-sample.yml +++ b/.github/workflows/lint-sample.yml @@ -1,14 +1,15 @@ -# Copyright 2023 The Caramello-io Authors. - -name: Sample Testdata Tests +name: Linting Samples on: push: + paths-ignore: + - '**/*.md' pull_request: + paths-ignore: + - '**/*.md' jobs: - test: - name: "Testdata - make test" + lint: runs-on: ubuntu-latest if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) steps: @@ -18,36 +19,14 @@ jobs: uses: actions/setup-go@v5 with: go-version: '~1.22' - - name: Remove pre-installed kustomize - run: sudo rm -f /usr/local/bin/kustomize - - name: Run make test for project-v4-with-deploy-image - run: cd testdata/project-v4-with-deploy-image && go mod tidy && make all && make test - - name: Run make test for project-v4-multigroup-with-deploy-image - run: cd testdata/project-v4-multigroup-with-deploy-image && go mod tidy && make all && make test - lint: - name: "Testdata - Lint" - runs-on: ubuntu-latest - # Pull requests from the same repository won't trigger this checks as they were already triggered by the push - if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) - steps: - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: '~1.22' - - name: Clone the code - uses: actions/checkout@v4 - - name: Run linter - uses: golangci/golangci-lint-action@v6 - with: - version: v1.57 - working-directory: testdata/project-v4-with-deploy-image - args: --config .golangci.yml ./... - skip-cache: true # first lint action will handle - - name: Run linter - uses: golangci/golangci-lint-action@v6 - with: - version: v1.57 - working-directory: testdata/project-v4-multigroup-with-deploy-image - args: --config .golangci.yml ./... - skip-cache: true # first lint action will handle + - name: Testing Lint for project-v4 + working-directory: testdata/project-v4 + run: | + cd testdata/project-v4/ + make lint + + - name: Testing Lint for project-v4-with-deploy-image + working-directory: testdata/project-v4-with-deploy-image + run: | + make lint diff --git a/docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml b/docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml index aac8a13f928..46b95300c89 100644 --- a/docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml +++ b/docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml @@ -36,7 +36,6 @@ linters: - prealloc - revive - staticcheck - - typecheck - unconvert - unparam - unused diff --git a/docs/book/src/getting-started/testdata/project/.golangci.yml b/docs/book/src/getting-started/testdata/project/.golangci.yml index aac8a13f928..46b95300c89 100644 --- a/docs/book/src/getting-started/testdata/project/.golangci.yml +++ b/docs/book/src/getting-started/testdata/project/.golangci.yml @@ -36,7 +36,6 @@ linters: - prealloc - revive - staticcheck - - typecheck - unconvert - unparam - unused diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/golangci.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/golangci.go index f4376036ae4..5dd239ad9d1 100644 --- a/pkg/plugins/golang/v4/scaffolds/internal/templates/golangci.go +++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/golangci.go @@ -80,7 +80,6 @@ linters: - prealloc - revive - staticcheck - - typecheck - unconvert - unparam - unused diff --git a/testdata/project-v4-multigroup-with-deploy-image/.golangci.yml b/testdata/project-v4-multigroup-with-deploy-image/.golangci.yml index aac8a13f928..46b95300c89 100644 --- a/testdata/project-v4-multigroup-with-deploy-image/.golangci.yml +++ b/testdata/project-v4-multigroup-with-deploy-image/.golangci.yml @@ -36,7 +36,6 @@ linters: - prealloc - revive - staticcheck - - typecheck - unconvert - unparam - unused diff --git a/testdata/project-v4-multigroup/.golangci.yml b/testdata/project-v4-multigroup/.golangci.yml index aac8a13f928..46b95300c89 100644 --- a/testdata/project-v4-multigroup/.golangci.yml +++ b/testdata/project-v4-multigroup/.golangci.yml @@ -36,7 +36,6 @@ linters: - prealloc - revive - staticcheck - - typecheck - unconvert - unparam - unused diff --git a/testdata/project-v4-with-deploy-image/.golangci.yml b/testdata/project-v4-with-deploy-image/.golangci.yml index aac8a13f928..46b95300c89 100644 --- a/testdata/project-v4-with-deploy-image/.golangci.yml +++ b/testdata/project-v4-with-deploy-image/.golangci.yml @@ -36,7 +36,6 @@ linters: - prealloc - revive - staticcheck - - typecheck - unconvert - unparam - unused diff --git a/testdata/project-v4-with-grafana/.golangci.yml b/testdata/project-v4-with-grafana/.golangci.yml index aac8a13f928..46b95300c89 100644 --- a/testdata/project-v4-with-grafana/.golangci.yml +++ b/testdata/project-v4-with-grafana/.golangci.yml @@ -36,7 +36,6 @@ linters: - prealloc - revive - staticcheck - - typecheck - unconvert - unparam - unused diff --git a/testdata/project-v4/.golangci.yml b/testdata/project-v4/.golangci.yml index aac8a13f928..46b95300c89 100644 --- a/testdata/project-v4/.golangci.yml +++ b/testdata/project-v4/.golangci.yml @@ -36,7 +36,6 @@ linters: - prealloc - revive - staticcheck - - typecheck - unconvert - unparam - unused