From 0b6095ff8604a2d135e6eb522e3c7919ff5cb555 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Wed, 21 Jun 2023 20:49:17 +0200 Subject: [PATCH 01/10] chore: update workflows --- .github/workflows/documentation.yml | 2 +- .github/workflows/post-release.yml | 2 +- .github/workflows/pr-extra.yml | 2 +- .github/workflows/pr.yml | 8 +++++--- .github/workflows/tag.yml | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 55d7f040cfd0..8fa9043ece7e 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -11,7 +11,7 @@ jobs: name: Build and deploy documentation runs-on: ubuntu-latest env: - GO_VERSION: '1.20' + GO_VERSION: '1.21.0-rc.2' NODE_VERSION: '20.x' CGO_ENABLED: 0 diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml index de59eaf821f7..e75f24088add 100644 --- a/.github/workflows/post-release.yml +++ b/.github/workflows/post-release.yml @@ -18,7 +18,7 @@ jobs: # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 - go-version: '1.20' + go-version: '1.21.0-rc.2' - name: Update GitHub action config run: make assets/github-action-config.json diff --git a/.github/workflows/pr-extra.yml b/.github/workflows/pr-extra.yml index f0aae711ef83..ade0d0bd1177 100644 --- a/.github/workflows/pr-extra.yml +++ b/.github/workflows/pr-extra.yml @@ -17,7 +17,7 @@ jobs: # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 - go-version: '1.20' + go-version: '1.21.0-rc.2' - name: Run go list run: go list -json -m all > go.list - name: Nancy diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index d272c488b6cc..8887e69f1dfc 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -6,7 +6,7 @@ on: pull_request: env: - GO_VERSION: '1.20' + GO_VERSION: '1.21.0-rc.2' jobs: # Check if there is any dirty change for go mod tidy @@ -41,7 +41,9 @@ jobs: # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 - go-version: ${{ env.GO_VERSION }} + # TODO(ldez) must be changed after the first release of golangci-lint with go1.20 + # go-version: ${{ env.GO_VERSION }} + go-version: '1.20' - name: lint uses: golangci/golangci-lint-action@v3.6.0 with: @@ -88,8 +90,8 @@ jobs: strategy: matrix: golang: - - 1.19 - '1.20' + - '1.21.0-rc.2' steps: - uses: actions/checkout@v3 - name: Install Go diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 58a38969f626..2b81e34a65c9 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -18,7 +18,7 @@ jobs: # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 - go-version: '1.20' + go-version: '1.21.0-rc.2' - name: Unshallow run: git fetch --prune --unshallow @@ -48,7 +48,7 @@ jobs: # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 - go-version: '1.20' + go-version: '1.21.0-rc.2' - name: Unshallow run: git fetch --prune --unshallow From 4b7391368b89c8b1ea3f6f8b91d892cf00d1193b Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Fri, 14 Jul 2023 18:09:13 +0200 Subject: [PATCH 02/10] chore: 1.21.0-rc.3 --- .github/workflows/documentation.yml | 2 +- .github/workflows/post-release.yml | 2 +- .github/workflows/pr-extra.yml | 2 +- .github/workflows/pr.yml | 6 +++--- .github/workflows/tag.yml | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 8fa9043ece7e..501105428a43 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -11,7 +11,7 @@ jobs: name: Build and deploy documentation runs-on: ubuntu-latest env: - GO_VERSION: '1.21.0-rc.2' + GO_VERSION: '1.21.0-rc.3' NODE_VERSION: '20.x' CGO_ENABLED: 0 diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml index e75f24088add..c4f9fa8e9da7 100644 --- a/.github/workflows/post-release.yml +++ b/.github/workflows/post-release.yml @@ -18,7 +18,7 @@ jobs: # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 - go-version: '1.21.0-rc.2' + go-version: '1.21.0-rc.3' - name: Update GitHub action config run: make assets/github-action-config.json diff --git a/.github/workflows/pr-extra.yml b/.github/workflows/pr-extra.yml index ade0d0bd1177..752ba99a9602 100644 --- a/.github/workflows/pr-extra.yml +++ b/.github/workflows/pr-extra.yml @@ -17,7 +17,7 @@ jobs: # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 - go-version: '1.21.0-rc.2' + go-version: '1.21.0-rc.3' - name: Run go list run: go list -json -m all > go.list - name: Nancy diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 8887e69f1dfc..1ab554b87825 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -6,7 +6,7 @@ on: pull_request: env: - GO_VERSION: '1.21.0-rc.2' + GO_VERSION: '1.21.0-rc.3' jobs: # Check if there is any dirty change for go mod tidy @@ -41,7 +41,7 @@ jobs: # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 - # TODO(ldez) must be changed after the first release of golangci-lint with go1.20 + # TODO(ldez) must be changed after the first release of golangci-lint with go1.21 # go-version: ${{ env.GO_VERSION }} go-version: '1.20' - name: lint @@ -91,7 +91,7 @@ jobs: matrix: golang: - '1.20' - - '1.21.0-rc.2' + - '1.21.0-rc.3' steps: - uses: actions/checkout@v3 - name: Install Go diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 2b81e34a65c9..32ce509b0ab4 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -18,7 +18,7 @@ jobs: # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 - go-version: '1.21.0-rc.2' + go-version: '1.21.0-rc.3' - name: Unshallow run: git fetch --prune --unshallow @@ -48,7 +48,7 @@ jobs: # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 - go-version: '1.21.0-rc.2' + go-version: '1.21.0-rc.3' - name: Unshallow run: git fetch --prune --unshallow From a60673be49c2eb0249439bc3d6d3b5457fc9f5e8 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Wed, 2 Aug 2023 19:14:52 +0200 Subject: [PATCH 03/10] chore: 1.21.0-rc.4 --- .github/workflows/documentation.yml | 2 +- .github/workflows/post-release.yml | 2 +- .github/workflows/pr-extra.yml | 2 +- .github/workflows/pr.yml | 4 ++-- .github/workflows/tag.yml | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 501105428a43..426415abdb66 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -11,7 +11,7 @@ jobs: name: Build and deploy documentation runs-on: ubuntu-latest env: - GO_VERSION: '1.21.0-rc.3' + GO_VERSION: '1.21.0-rc.4' NODE_VERSION: '20.x' CGO_ENABLED: 0 diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml index c4f9fa8e9da7..3539150c7ffd 100644 --- a/.github/workflows/post-release.yml +++ b/.github/workflows/post-release.yml @@ -18,7 +18,7 @@ jobs: # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 - go-version: '1.21.0-rc.3' + go-version: '1.21.0-rc.4' - name: Update GitHub action config run: make assets/github-action-config.json diff --git a/.github/workflows/pr-extra.yml b/.github/workflows/pr-extra.yml index 752ba99a9602..6872aa44e029 100644 --- a/.github/workflows/pr-extra.yml +++ b/.github/workflows/pr-extra.yml @@ -17,7 +17,7 @@ jobs: # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 - go-version: '1.21.0-rc.3' + go-version: '1.21.0-rc.4' - name: Run go list run: go list -json -m all > go.list - name: Nancy diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 1ab554b87825..09394e9894b9 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -6,7 +6,7 @@ on: pull_request: env: - GO_VERSION: '1.21.0-rc.3' + GO_VERSION: '1.21.0-rc.4' jobs: # Check if there is any dirty change for go mod tidy @@ -91,7 +91,7 @@ jobs: matrix: golang: - '1.20' - - '1.21.0-rc.3' + - '1.21.0-rc.4' steps: - uses: actions/checkout@v3 - name: Install Go diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 32ce509b0ab4..e0d58e1fb733 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -18,7 +18,7 @@ jobs: # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 - go-version: '1.21.0-rc.3' + go-version: '1.21.0-rc.4' - name: Unshallow run: git fetch --prune --unshallow @@ -48,7 +48,7 @@ jobs: # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 - go-version: '1.21.0-rc.3' + go-version: '1.21.0-rc.4' - name: Unshallow run: git fetch --prune --unshallow From 04a7b0bbffb460b5600b2f486f9bf90a12a2e67c Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Tue, 8 Aug 2023 17:37:55 +0200 Subject: [PATCH 04/10] chore: go1.21 --- .github/workflows/documentation.yml | 2 +- .github/workflows/post-release.yml | 2 +- .github/workflows/pr-extra.yml | 2 +- .github/workflows/pr.yml | 4 ++-- .github/workflows/tag.yml | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 426415abdb66..219ffdc64f10 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -11,7 +11,7 @@ jobs: name: Build and deploy documentation runs-on: ubuntu-latest env: - GO_VERSION: '1.21.0-rc.4' + GO_VERSION: '1.21' NODE_VERSION: '20.x' CGO_ENABLED: 0 diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml index 3539150c7ffd..5b53ab39c7fc 100644 --- a/.github/workflows/post-release.yml +++ b/.github/workflows/post-release.yml @@ -18,7 +18,7 @@ jobs: # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 - go-version: '1.21.0-rc.4' + go-version: '1.21' - name: Update GitHub action config run: make assets/github-action-config.json diff --git a/.github/workflows/pr-extra.yml b/.github/workflows/pr-extra.yml index 6872aa44e029..9fc7b4720a41 100644 --- a/.github/workflows/pr-extra.yml +++ b/.github/workflows/pr-extra.yml @@ -17,7 +17,7 @@ jobs: # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 - go-version: '1.21.0-rc.4' + go-version: '1.21' - name: Run go list run: go list -json -m all > go.list - name: Nancy diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 09394e9894b9..f1323fe6309f 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -6,7 +6,7 @@ on: pull_request: env: - GO_VERSION: '1.21.0-rc.4' + GO_VERSION: '1.21' jobs: # Check if there is any dirty change for go mod tidy @@ -91,7 +91,7 @@ jobs: matrix: golang: - '1.20' - - '1.21.0-rc.4' + - '1.21' steps: - uses: actions/checkout@v3 - name: Install Go diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index e0d58e1fb733..0c05b61c3fb5 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -18,7 +18,7 @@ jobs: # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 - go-version: '1.21.0-rc.4' + go-version: '1.21' - name: Unshallow run: git fetch --prune --unshallow @@ -48,7 +48,7 @@ jobs: # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 - go-version: '1.21.0-rc.4' + go-version: '1.21' - name: Unshallow run: git fetch --prune --unshallow From 14f0e90aa5621429ff440d0b2a80312dd7f05d54 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Tue, 8 Aug 2023 17:41:09 +0200 Subject: [PATCH 05/10] wip: disable gocritic --- pkg/config/config.go | 4 ++-- pkg/lint/linter/config.go | 2 +- pkg/lint/lintersdb/manager.go | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index af40c63bdbe2..7941f428f4f5 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -41,13 +41,13 @@ type Version struct { Debug bool `mapstructure:"debug"` } -func IsGreaterThanOrEqualGo118(v string) bool { +func IsGreaterThanOrEqualGo121(v string) bool { v1, err := hcversion.NewVersion(strings.TrimPrefix(v, "go")) if err != nil { return false } - limit, err := hcversion.NewVersion("1.18") + limit, err := hcversion.NewVersion("1.21") if err != nil { return false } diff --git a/pkg/lint/linter/config.go b/pkg/lint/linter/config.go index 0376afba61b5..c911b5613daf 100644 --- a/pkg/lint/linter/config.go +++ b/pkg/lint/linter/config.go @@ -134,7 +134,7 @@ func (lc *Config) Name() string { } func (lc *Config) WithNoopFallback(cfg *config.Config) *Config { - if cfg != nil && config.IsGreaterThanOrEqualGo118(cfg.Run.Go) { + if cfg != nil && config.IsGreaterThanOrEqualGo121(cfg.Run.Go) { lc.Linter = &Noop{ name: lc.Linter.Name(), desc: lc.Linter.Desc(), diff --git a/pkg/lint/lintersdb/manager.go b/pkg/lint/lintersdb/manager.go index 16b1babfafd2..3e3ee05e4114 100644 --- a/pkg/lint/lintersdb/manager.go +++ b/pkg/lint/lintersdb/manager.go @@ -451,7 +451,8 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { WithSince("v1.12.0"). WithPresets(linter.PresetStyle, linter.PresetMetaLinter). WithLoadForGoAnalysis(). - WithURL("https://github.com/go-critic/go-critic"), + WithURL("https://github.com/go-critic/go-critic"). + WithNoopFallback(m.cfg), linter.NewConfig(golinters.NewGocyclo(gocycloCfg)). WithSince("v1.0.0"). From 0cf0d97c96f95e442dd5ca9aec7ba7bbcfd1a233 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Tue, 8 Aug 2023 18:23:51 +0200 Subject: [PATCH 06/10] chore: update go.mod --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 823d0c7aeec1..c5b465cde7e7 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/golangci/golangci-lint -go 1.19 +go 1.20 require ( 4d63.com/gocheckcompilerdirectives v1.2.1 From 5e35d1031349953844dd6a7fe673c2655bf12f00 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Tue, 8 Aug 2023 19:05:01 +0200 Subject: [PATCH 07/10] wip: disable ruleguard --- pkg/golinters/gocritic.go | 14 ++++++++++++++ pkg/lint/lintersdb/manager.go | 3 +-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/pkg/golinters/gocritic.go b/pkg/golinters/gocritic.go index 1319c72d9d42..ffac384ed2e7 100644 --- a/pkg/golinters/gocritic.go +++ b/pkg/golinters/gocritic.go @@ -283,6 +283,20 @@ func newGoCriticSettingsWrapper(settings *config.GoCriticSettings, logger loguti allCheckerMap[checkInfo.Name] = checkInfo } + if settings != nil && config.IsGreaterThanOrEqualGo121(settings.Go) { + var enabledChecks []string + for _, check := range settings.EnabledChecks { + if check == "ruleguard" { + logger.Warnf("%s: check %q is disabled for go1.21 https://github.com/golangci/golangci-lint/issues/3933", goCriticName, "ruleguard") + continue + } + + enabledChecks = append(enabledChecks, check) + } + + settings.EnabledChecks = enabledChecks + } + return &goCriticSettingsWrapper{ GoCriticSettings: settings, logger: logger, diff --git a/pkg/lint/lintersdb/manager.go b/pkg/lint/lintersdb/manager.go index 3e3ee05e4114..16b1babfafd2 100644 --- a/pkg/lint/lintersdb/manager.go +++ b/pkg/lint/lintersdb/manager.go @@ -451,8 +451,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { WithSince("v1.12.0"). WithPresets(linter.PresetStyle, linter.PresetMetaLinter). WithLoadForGoAnalysis(). - WithURL("https://github.com/go-critic/go-critic"). - WithNoopFallback(m.cfg), + WithURL("https://github.com/go-critic/go-critic"), linter.NewConfig(golinters.NewGocyclo(gocycloCfg)). WithSince("v1.0.0"). From 82f86bbf9e9008d56717f0f7e3a51f1990285ccd Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Tue, 8 Aug 2023 21:35:40 +0200 Subject: [PATCH 08/10] wip: skip tests based on ruleguard --- .golangci.yml | 2 ++ test/fix_test.go | 12 ++++++++++++ test/linters_test.go | 6 ++++++ 3 files changed, 20 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index d34c3c83218d..349d909d760d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -155,6 +155,8 @@ issues: text: "SA1019: (.+).(GoVersion|LangVersion) is deprecated: use the global `run.go` instead." - path: pkg/golinters/unused.go text: "rangeValCopy: each iteration copies 160 bytes \\(consider pointers or indexing\\)" + - path: test/(fix|linters)_test.go + text: "string `gocritic.go` has 3 occurrences, make it a constant" run: timeout: 5m diff --git a/test/fix_test.go b/test/fix_test.go index 4f35f3309d00..db9025d87fd6 100644 --- a/test/fix_test.go +++ b/test/fix_test.go @@ -43,6 +43,12 @@ func TestFix(t *testing.T) { for _, input := range sources { input := input + + if filepath.Base(input) == "gocritic.go" { + t.Logf("skip gocritic because of a bug with ruleguard") + continue + } + t.Run(filepath.Base(input), func(t *testing.T) { t.Parallel() @@ -80,6 +86,12 @@ func TestFix_pathPrefix(t *testing.T) { for _, input := range sources { input := input + + if filepath.Base(input) == "gocritic.go" { + t.Logf("skip gocritic because of a bug with ruleguard") + continue + } + t.Run(filepath.Base(input), func(t *testing.T) { t.Parallel() diff --git a/test/linters_test.go b/test/linters_test.go index dd130db3e7db..5d53a0d31563 100644 --- a/test/linters_test.go +++ b/test/linters_test.go @@ -62,6 +62,12 @@ func testSourcesFromDir(t *testing.T, dir string) { for _, source := range sources { source := source + + if filepath.Base(source) == "gocritic.go" { + t.Logf("skip gocritic because of a bug with ruleguard") + continue + } + t.Run(filepath.Base(source), func(subTest *testing.T) { subTest.Parallel() From 1bda81589e809a654cb19cd9d1cff6adfcb29f1f Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Wed, 9 Aug 2023 11:28:58 +0200 Subject: [PATCH 09/10] chore: update Dockerfile --- build/Dockerfile | 4 ++-- build/alpine.Dockerfile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index 3488446b7c71..a8560c9da71a 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,5 +1,5 @@ # stage 1 building the code -FROM golang:1.20 as builder +FROM golang:1.21 as builder ARG VERSION ARG SHORT_COMMIT @@ -10,7 +10,7 @@ WORKDIR /golangci RUN CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=$VERSION -X main.commit=$SHORT_COMMIT -X main.date=$DATE" -o golangci-lint ./cmd/golangci-lint/main.go # stage 2 -FROM golang:1.20 +FROM golang:1.21 # related to https://github.com/golangci/golangci-lint/issues/3107 ENV GOROOT /usr/local/go # don't place it into $GOPATH/bin because Drone mounts $GOPATH as volume diff --git a/build/alpine.Dockerfile b/build/alpine.Dockerfile index 5eeb76228de2..f66e5aee1cc8 100644 --- a/build/alpine.Dockerfile +++ b/build/alpine.Dockerfile @@ -1,5 +1,5 @@ # stage 1 building the code -FROM golang:1.20-alpine as builder +FROM golang:1.21-alpine as builder ARG VERSION ARG SHORT_COMMIT @@ -15,7 +15,7 @@ RUN apk --no-cache add gcc musl-dev git mercurial RUN CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=$VERSION -X main.commit=$SHORT_COMMIT -X main.date=$DATE" -o golangci-lint ./cmd/golangci-lint/main.go # stage 2 -FROM golang:1.20-alpine +FROM golang:1.21-alpine # related to https://github.com/golangci/golangci-lint/issues/3107 ENV GOROOT /usr/local/go # gcc is required to support cgo; From 4bc9958bb6af8c760574e802b1b2ad5d95e8bdc1 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Wed, 9 Aug 2023 11:41:07 +0200 Subject: [PATCH 10/10] chore: add comments --- test/fix_test.go | 2 ++ test/linters_test.go | 1 + 2 files changed, 3 insertions(+) diff --git a/test/fix_test.go b/test/fix_test.go index db9025d87fd6..12f54d0ad3f5 100644 --- a/test/fix_test.go +++ b/test/fix_test.go @@ -44,6 +44,7 @@ func TestFix(t *testing.T) { for _, input := range sources { input := input + // TODO(ldez): remove this limitation when gocritic/ruleguard will be fixed. if filepath.Base(input) == "gocritic.go" { t.Logf("skip gocritic because of a bug with ruleguard") continue @@ -87,6 +88,7 @@ func TestFix_pathPrefix(t *testing.T) { for _, input := range sources { input := input + // TODO(ldez): remove this limitation when gocritic/ruleguard will be fixed. if filepath.Base(input) == "gocritic.go" { t.Logf("skip gocritic because of a bug with ruleguard") continue diff --git a/test/linters_test.go b/test/linters_test.go index 5d53a0d31563..d76481b6608d 100644 --- a/test/linters_test.go +++ b/test/linters_test.go @@ -63,6 +63,7 @@ func testSourcesFromDir(t *testing.T, dir string) { for _, source := range sources { source := source + // TODO(ldez): remove this limitation when gocritic/ruleguard will be fixed. if filepath.Base(source) == "gocritic.go" { t.Logf("skip gocritic because of a bug with ruleguard") continue