diff --git a/.golangci.reference.yml b/.golangci.reference.yml index 7abf717c4e38..f7de593aac0e 100644 --- a/.golangci.reference.yml +++ b/.golangci.reference.yml @@ -449,6 +449,10 @@ linters-settings: # Default: false suppress-async-assertion: true + # Suppress warning for ginkgo focus containers like FDescribe, FContext, FWhen or FIt + # Default: false + suppress-focus-container: true + # Don't trigger warnings for HaveLen(0) # Default: false allow-havelen-zero: true diff --git a/go.mod b/go.mod index 7330c28419a8..9cce20aa8e3b 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.12.2 + github.com/nunnatsa/ginkgolinter v0.13.0 github.com/polyfloyd/go-errorlint v1.4.3 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 7f2aa2bfbba9..1bc2c9d9e13c 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.12.2 h1:dhRygTgi9FscUyrSXwS2g+/kZiE8vwp2+cZi96Yn2TI= -github.com/nunnatsa/ginkgolinter v0.12.2/go.mod h1://chQwTN4ZCq3aT5xj+r4jSiZWD3W4baNR7acr0TM5A= +github.com/nunnatsa/ginkgolinter v0.13.0 h1:kvnXNJXKDcYXTlHsgsfc1dQNziWASXAtQ3xyExV3v6U= +github.com/nunnatsa/ginkgolinter v0.13.0/go.mod h1:aTKXo8WddENYxNEFT+4ZxEgWXqlD9uMD3w9Bfw/ABEc= 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.9.4 h1:xR7vG4IXt5RWx6FfIjyAtsoMAtnc3C/rFXBBd2AjZwE= diff --git a/pkg/config/linters_settings.go b/pkg/config/linters_settings.go index de2ec439f647..f930a8aa9be3 100644 --- a/pkg/config/linters_settings.go +++ b/pkg/config/linters_settings.go @@ -396,6 +396,7 @@ type GinkgoLinterSettings struct { SuppressErrAssertion bool `mapstructure:"suppress-err-assertion"` SuppressCompareAssertion bool `mapstructure:"suppress-compare-assertion"` SuppressAsyncAssertion bool `mapstructure:"suppress-async-assertion"` + SuppressFocusContainer bool `mapstructure:"suppress-focus-container"` AllowHaveLenZero bool `mapstructure:"allow-havelen-zero"` } diff --git a/pkg/golinters/ginkgolinter.go b/pkg/golinters/ginkgolinter.go index b9e69b265d9c..136457b74903 100644 --- a/pkg/golinters/ginkgolinter.go +++ b/pkg/golinters/ginkgolinter.go @@ -19,6 +19,7 @@ func NewGinkgoLinter(cfg *config.GinkgoLinterSettings) *goanalysis.Linter { "suppress-err-assertion": cfg.SuppressErrAssertion, "suppress-compare-assertion": cfg.SuppressCompareAssertion, "suppress-async-assertion": cfg.SuppressAsyncAssertion, + "suppress-focus-container": cfg.SuppressFocusContainer, "allow-havelen-0": cfg.AllowHaveLenZero, } }