From ea4481a1968f2a604100c26b81d4297bf34b1f2f Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Thu, 10 Aug 2023 12:11:03 +0200 Subject: [PATCH] build(deps): bump github.com/quasilyte/go-ruleguard from v0.3.19 to v0.4.0 (#3999) --- go.mod | 4 ++-- go.sum | 8 ++++---- pkg/golinters/gocritic.go | 14 -------------- test/fix_test.go | 12 ------------ test/linters_test.go | 7 ------- 5 files changed, 6 insertions(+), 39 deletions(-) diff --git a/go.mod b/go.mod index c5b465cde7e7..51a9c938fb0c 100644 --- a/go.mod +++ b/go.mod @@ -166,7 +166,7 @@ require ( github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect - github.com/quasilyte/go-ruleguard v0.3.19 // indirect + github.com/quasilyte/go-ruleguard v0.4.0 // indirect github.com/quasilyte/gogrep v0.5.0 // indirect github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect @@ -184,7 +184,7 @@ require ( go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect go.uber.org/zap v1.24.0 // indirect - golang.org/x/exp/typeparams v0.0.0-20230224173230-c95f2b4c22f2 // indirect + golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect golang.org/x/mod v0.12.0 // indirect golang.org/x/sync v0.3.0 // indirect golang.org/x/sys v0.11.0 // indirect diff --git a/go.sum b/go.sum index cabbd59497f6..3a30c4cf0bd3 100644 --- a/go.sum +++ b/go.sum @@ -441,8 +441,8 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/quasilyte/go-ruleguard v0.3.19 h1:tfMnabXle/HzOb5Xe9CUZYWXKfkS1KwRmZyPmD9nVcc= -github.com/quasilyte/go-ruleguard v0.3.19/go.mod h1:lHSn69Scl48I7Gt9cX3VrbsZYvYiBYszZOZW4A+oTEw= +github.com/quasilyte/go-ruleguard v0.4.0 h1:DyM6r+TKL+xbKB4Nm7Afd1IQh9kEUKQs2pboWGKtvQo= +github.com/quasilyte/go-ruleguard v0.4.0/go.mod h1:Eu76Z/R8IXtViWUIHkE3p8gdH3/PKk1eh3YGfaEof10= github.com/quasilyte/go-ruleguard/dsl v0.3.22 h1:wd8zkOhSNr+I+8Qeciml08ivDt1pSXe60+5DqOpCjPE= github.com/quasilyte/go-ruleguard/dsl v0.3.22/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= github.com/quasilyte/gogrep v0.5.0 h1:eTKODPXbI8ffJMN+W2aE0+oL0z/nh8/5eNdiO34SOAo= @@ -619,8 +619,8 @@ golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea h1:vLCWI/yYrdEHyN2JzIzPO3aaQ golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/exp/typeparams v0.0.0-20230224173230-c95f2b4c22f2 h1:J74nGeMgeFnYQJN59eFwh06jX/V8g0lB7LWpjSLxtgU= -golang.org/x/exp/typeparams v0.0.0-20230224173230-c95f2b4c22f2/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 h1:jWGQJV4niP+CCmFW9ekjA9Zx8vYORzOUH2/Nl5WPuLQ= +golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= diff --git a/pkg/golinters/gocritic.go b/pkg/golinters/gocritic.go index ffac384ed2e7..1319c72d9d42 100644 --- a/pkg/golinters/gocritic.go +++ b/pkg/golinters/gocritic.go @@ -283,20 +283,6 @@ 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/test/fix_test.go b/test/fix_test.go index 12f54d0ad3f5..87dff82dbe3d 100644 --- a/test/fix_test.go +++ b/test/fix_test.go @@ -44,12 +44,6 @@ 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 - } - t.Run(filepath.Base(input), func(t *testing.T) { t.Parallel() @@ -88,12 +82,6 @@ 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 - } - t.Run(filepath.Base(input), func(t *testing.T) { t.Parallel() diff --git a/test/linters_test.go b/test/linters_test.go index d76481b6608d..dd130db3e7db 100644 --- a/test/linters_test.go +++ b/test/linters_test.go @@ -62,13 +62,6 @@ 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 - } - t.Run(filepath.Base(source), func(subTest *testing.T) { subTest.Parallel()