build(deps): bump github.com/nunnatsa/ginkgolinter from 0.16.0 to 0.16.1 (#4531)

Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
This commit is contained in:
dependabot[bot] 2024-03-18 18:04:49 +01:00 committed by GitHub
parent f83707049f
commit f2d411006a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 20 additions and 18 deletions

2
go.mod
View File

@ -79,7 +79,7 @@ require (
github.com/nakabonne/nestif v0.3.1
github.com/nishanths/exhaustive v0.12.0
github.com/nishanths/predeclared v0.2.2
github.com/nunnatsa/ginkgolinter v0.16.0
github.com/nunnatsa/ginkgolinter v0.16.1
github.com/polyfloyd/go-errorlint v1.4.8
github.com/quasilyte/go-ruleguard/dsl v0.3.22
github.com/ryancurrah/gomodguard v1.3.0

4
go.sum generated
View File

@ -393,8 +393,8 @@ github.com/nishanths/exhaustive v0.12.0 h1:vIY9sALmw6T/yxiASewa4TQcFsVYZQQRUQJhK
github.com/nishanths/exhaustive v0.12.0/go.mod h1:mEZ95wPIZW+x8kC4TgC+9YCUgiST7ecevsVDTgc2obs=
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.16.0 h1:typ0xsoXQTD4O7+uMQCsXRIzADdwROr5CcKVoOY1wd4=
github.com/nunnatsa/ginkgolinter v0.16.0/go.mod h1:4tWRinDN1FeJgU+iJANW/kz7xKN5nYRAOfJDQUS9dOQ=
github.com/nunnatsa/ginkgolinter v0.16.1 h1:uDIPSxgVHZ7PgbJElRDGzymkXH+JaF7mjew+Thjnt6Q=
github.com/nunnatsa/ginkgolinter v0.16.1/go.mod h1:4tWRinDN1FeJgU+iJANW/kz7xKN5nYRAOfJDQUS9dOQ=
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.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY=

View File

@ -2,6 +2,7 @@ package golinters
import (
"github.com/nunnatsa/ginkgolinter"
"github.com/nunnatsa/ginkgolinter/types"
"golang.org/x/tools/go/analysis"
"github.com/golangci/golangci-lint/pkg/config"
@ -9,29 +10,30 @@ import (
)
func NewGinkgoLinter(settings *config.GinkgoLinterSettings) *goanalysis.Linter {
a := ginkgolinter.NewAnalyzer()
cfg := &types.Config{}
cfgMap := make(map[string]map[string]any)
if settings != nil {
cfgMap[a.Name] = map[string]any{
"suppress-len-assertion": settings.SuppressLenAssertion,
"suppress-nil-assertion": settings.SuppressNilAssertion,
"suppress-err-assertion": settings.SuppressErrAssertion,
"suppress-compare-assertion": settings.SuppressCompareAssertion,
"suppress-async-assertion": settings.SuppressAsyncAssertion,
"suppress-type-compare-assertion": settings.SuppressTypeCompareWarning,
"forbid-focus-container": settings.ForbidFocusContainer,
"allow-havelen-0": settings.AllowHaveLenZero,
"force-expect-to": settings.ForceExpectTo,
"forbid-spec-pollution": settings.ForbidSpecPollution,
"validate-async-intervals": settings.ValidateAsyncIntervals,
cfg = &types.Config{
SuppressLen: types.Boolean(settings.SuppressLenAssertion),
SuppressNil: types.Boolean(settings.SuppressNilAssertion),
SuppressErr: types.Boolean(settings.SuppressErrAssertion),
SuppressCompare: types.Boolean(settings.SuppressCompareAssertion),
SuppressAsync: types.Boolean(settings.SuppressAsyncAssertion),
ForbidFocus: types.Boolean(settings.ForbidFocusContainer),
SuppressTypeCompare: types.Boolean(settings.SuppressTypeCompareWarning),
AllowHaveLen0: types.Boolean(settings.AllowHaveLenZero),
ForceExpectTo: types.Boolean(settings.ForceExpectTo),
ValidateAsyncIntervals: types.Boolean(settings.ForbidSpecPollution),
ForbidSpecPollution: types.Boolean(settings.ValidateAsyncIntervals),
}
}
a := ginkgolinter.NewAnalyzerWithConfig(cfg)
return goanalysis.NewLinter(
a.Name,
"enforces standards of using ginkgo and gomega",
[]*analysis.Analyzer{a},
cfgMap,
nil,
).WithLoadMode(goanalysis.LoadModeTypesInfo)
}