From 0ee465a4446d9a451070ab173150944a192af6ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 8 Oct 2023 11:19:42 +0000 Subject: [PATCH 1/2] build(deps): bump github.com/nunnatsa/ginkgolinter from 0.13.5 to 0.14.0 Bumps [github.com/nunnatsa/ginkgolinter](https://github.com/nunnatsa/ginkgolinter) from 0.13.5 to 0.14.0. - [Release notes](https://github.com/nunnatsa/ginkgolinter/releases) - [Commits](https://github.com/nunnatsa/ginkgolinter/compare/v0.13.5...v0.14.0) --- updated-dependencies: - dependency-name: github.com/nunnatsa/ginkgolinter dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e1704841b6d0..ccec186401c5 100644 --- a/go.mod +++ b/go.mod @@ -77,7 +77,7 @@ require ( github.com/nakabonne/nestif v0.3.1 github.com/nishanths/exhaustive v0.11.0 github.com/nishanths/predeclared v0.2.2 - github.com/nunnatsa/ginkgolinter v0.13.5 + github.com/nunnatsa/ginkgolinter v0.14.0 github.com/polyfloyd/go-errorlint v1.4.5 github.com/quasilyte/go-ruleguard/dsl v0.3.22 github.com/ryancurrah/gomodguard v1.3.0 diff --git a/go.sum b/go.sum index 2b6f038e36ed..5aab59dd4349 100644 --- a/go.sum +++ b/go.sum @@ -392,8 +392,8 @@ github.com/nishanths/exhaustive v0.11.0 h1:T3I8nUGhl/Cwu5Z2hfc92l0e04D2GEW6e0l8p github.com/nishanths/exhaustive v0.11.0/go.mod h1:RqwDsZ1xY0dNdqHho2z6X+bgzizwbLYOWnZbbl2wLB4= github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= -github.com/nunnatsa/ginkgolinter v0.13.5 h1:fOsPB4CEZOPkyMqF4B9hoqOpooFWU7vWSVkCSscVpgU= -github.com/nunnatsa/ginkgolinter v0.13.5/go.mod h1:OBHy4536xtuX3102NM63XRtOyxqZOO02chsaeDWXVO8= +github.com/nunnatsa/ginkgolinter v0.14.0 h1:XQPNmw+kZz5cC/HbFK3mQutpjzAQv1dHregRA+4CGGg= +github.com/nunnatsa/ginkgolinter v0.14.0/go.mod h1:cm2xaqCUCRd7qcP4DqbVvpcyEMkuLM9CF0wY6VASohk= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= From a450f316d7501bf795750127a05c7c3fa72d29e5 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sun, 8 Oct 2023 13:58:58 +0200 Subject: [PATCH 2/2] chore: update implementation --- .golangci.reference.yml | 4 ++++ pkg/config/linters_settings.go | 15 ++++++++------- pkg/golinters/ginkgolinter.go | 15 ++++++++------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.golangci.reference.yml b/.golangci.reference.yml index f8c2ae148274..290add71e8de 100644 --- a/.golangci.reference.yml +++ b/.golangci.reference.yml @@ -456,6 +456,10 @@ linters-settings: # Default: false suppress-async-assertion: true + # Suppress warning for comparing values from different types, like int32 and uint32 + # Default: false + suppress-type-compare-assertion: true + # Trigger warning for ginkgo focus containers like FDescribe, FContext, FWhen or FIt # Default: false forbid-focus-container: true diff --git a/pkg/config/linters_settings.go b/pkg/config/linters_settings.go index 9c2b2ad37db7..320fd558f3ff 100644 --- a/pkg/config/linters_settings.go +++ b/pkg/config/linters_settings.go @@ -394,13 +394,14 @@ type GciSettings struct { } type GinkgoLinterSettings struct { - SuppressLenAssertion bool `mapstructure:"suppress-len-assertion"` - SuppressNilAssertion bool `mapstructure:"suppress-nil-assertion"` - SuppressErrAssertion bool `mapstructure:"suppress-err-assertion"` - SuppressCompareAssertion bool `mapstructure:"suppress-compare-assertion"` - SuppressAsyncAssertion bool `mapstructure:"suppress-async-assertion"` - ForbidFocusContainer bool `mapstructure:"forbid-focus-container"` - AllowHaveLenZero bool `mapstructure:"allow-havelen-zero"` + SuppressLenAssertion bool `mapstructure:"suppress-len-assertion"` + SuppressNilAssertion bool `mapstructure:"suppress-nil-assertion"` + SuppressErrAssertion bool `mapstructure:"suppress-err-assertion"` + SuppressCompareAssertion bool `mapstructure:"suppress-compare-assertion"` + SuppressAsyncAssertion bool `mapstructure:"suppress-async-assertion"` + SuppressTypeCompareWarning bool `mapstructure:"suppress-type-compare-assertion"` + ForbidFocusContainer bool `mapstructure:"forbid-focus-container"` + AllowHaveLenZero bool `mapstructure:"allow-havelen-zero"` } type GocognitSettings struct { diff --git a/pkg/golinters/ginkgolinter.go b/pkg/golinters/ginkgolinter.go index 7b8102b6314f..8919de15bf90 100644 --- a/pkg/golinters/ginkgolinter.go +++ b/pkg/golinters/ginkgolinter.go @@ -14,13 +14,14 @@ func NewGinkgoLinter(cfg *config.GinkgoLinterSettings) *goanalysis.Linter { cfgMap := make(map[string]map[string]any) if cfg != nil { cfgMap[a.Name] = map[string]any{ - "suppress-len-assertion": cfg.SuppressLenAssertion, - "suppress-nil-assertion": cfg.SuppressNilAssertion, - "suppress-err-assertion": cfg.SuppressErrAssertion, - "suppress-compare-assertion": cfg.SuppressCompareAssertion, - "suppress-async-assertion": cfg.SuppressAsyncAssertion, - "forbid-focus-container": cfg.ForbidFocusContainer, - "allow-havelen-0": cfg.AllowHaveLenZero, + "suppress-len-assertion": cfg.SuppressLenAssertion, + "suppress-nil-assertion": cfg.SuppressNilAssertion, + "suppress-err-assertion": cfg.SuppressErrAssertion, + "suppress-compare-assertion": cfg.SuppressCompareAssertion, + "suppress-async-assertion": cfg.SuppressAsyncAssertion, + "suppress-type-compare-assertion": cfg.SuppressTypeCompareWarning, + "forbid-focus-container": cfg.ForbidFocusContainer, + "allow-havelen-0": cfg.AllowHaveLenZero, } }