Skip to content

Commit 055e118

Browse files
committed
chore: update implementation
1 parent f2cf677 commit 055e118

File tree

4 files changed

+26
-15
lines changed

4 files changed

+26
-15
lines changed

.golangci.next.reference.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,10 @@ linters:
626626
# Default: false
627627
force-succeed: true
628628

629+
# Force adding assertion descriptions to gomega matchers.
630+
# Default: false
631+
force-assertion-description: true
632+
629633
gochecksumtype:
630634
# Presence of `default` case in switch statements satisfies exhaustiveness, if all members are not listed.
631635
# Default: true

jsonschema/golangci.next.jsonschema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,6 +1509,11 @@
15091509
"description": "Force using the Succeed matcher for error functions, and the HaveOccurred matcher for non-function error values.",
15101510
"type": "boolean",
15111511
"default": false
1512+
},
1513+
"force-assertion-description": {
1514+
"description": "Force adding assertion descriptions to gomega matchers.",
1515+
"type": "boolean",
1516+
"default": false
15121517
}
15131518
}
15141519
},

pkg/config/linters_settings.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ type GinkgoLinterSettings struct {
466466
ValidateAsyncIntervals bool `mapstructure:"validate-async-intervals"`
467467
ForbidSpecPollution bool `mapstructure:"forbid-spec-pollution"`
468468
ForceSucceedForFuncs bool `mapstructure:"force-succeed"`
469+
ForceAssertionDescription bool `mapstructure:"force-assertion-description"`
469470
}
470471

471472
type GoChecksumTypeSettings struct {

pkg/golinters/ginkgolinter/ginkgolinter.go

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,30 @@ package ginkgolinter
22

33
import (
44
"github.com/nunnatsa/ginkgolinter"
5-
"github.com/nunnatsa/ginkgolinter/types"
5+
glconfig "github.com/nunnatsa/ginkgolinter/config"
66

77
"github.com/golangci/golangci-lint/v2/pkg/config"
88
"github.com/golangci/golangci-lint/v2/pkg/goanalysis"
99
)
1010

1111
func New(settings *config.GinkgoLinterSettings) *goanalysis.Linter {
12-
cfg := &types.Config{}
12+
cfg := &glconfig.Config{}
1313

1414
if settings != nil {
15-
cfg = &types.Config{
16-
SuppressLen: settings.SuppressLenAssertion,
17-
SuppressNil: settings.SuppressNilAssertion,
18-
SuppressErr: settings.SuppressErrAssertion,
19-
SuppressCompare: settings.SuppressCompareAssertion,
20-
SuppressAsync: settings.SuppressAsyncAssertion,
21-
ForbidFocus: settings.ForbidFocusContainer,
22-
SuppressTypeCompare: settings.SuppressTypeCompareWarning,
23-
AllowHaveLen0: settings.AllowHaveLenZero,
24-
ForceExpectTo: settings.ForceExpectTo,
25-
ValidateAsyncIntervals: settings.ValidateAsyncIntervals,
26-
ForbidSpecPollution: settings.ForbidSpecPollution,
27-
ForceSucceedForFuncs: settings.ForceSucceedForFuncs,
15+
cfg = &glconfig.Config{
16+
SuppressLen: settings.SuppressLenAssertion,
17+
SuppressNil: settings.SuppressNilAssertion,
18+
SuppressErr: settings.SuppressErrAssertion,
19+
SuppressCompare: settings.SuppressCompareAssertion,
20+
SuppressAsync: settings.SuppressAsyncAssertion,
21+
ForbidFocus: settings.ForbidFocusContainer,
22+
SuppressTypeCompare: settings.SuppressTypeCompareWarning,
23+
AllowHaveLen0: settings.AllowHaveLenZero,
24+
ForceExpectTo: settings.ForceExpectTo,
25+
ValidateAsyncIntervals: settings.ValidateAsyncIntervals,
26+
ForbidSpecPollution: settings.ForbidSpecPollution,
27+
ForceSucceedForFuncs: settings.ForceSucceedForFuncs,
28+
ForceAssertionDescription: settings.ForceAssertionDescription,
2829
}
2930
}
3031

0 commit comments

Comments
 (0)