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/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= 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, } }