File tree Expand file tree Collapse file tree 6 files changed +16
-16
lines changed
pkg/golinters/ginkgolinter Expand file tree Collapse file tree 6 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ require (
82
82
github.com/nakabonne/nestif v0.3.1
83
83
github.com/nishanths/exhaustive v0.12.0
84
84
github.com/nishanths/predeclared v0.2.2
85
- github.com/nunnatsa/ginkgolinter v0.16.2
85
+ github.com/nunnatsa/ginkgolinter v0.17.0
86
86
github.com/pelletier/go-toml/v2 v2.2.3
87
87
github.com/polyfloyd/go-errorlint v1.6.0
88
88
github.com/quasilyte/go-ruleguard/dsl v0.3.22
@@ -190,7 +190,7 @@ require (
190
190
go.uber.org/atomic v1.7.0 // indirect
191
191
go.uber.org/multierr v1.6.0 // indirect
192
192
go.uber.org/zap v1.24.0 // indirect
193
- golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f // indirect
193
+ golang.org/x/exp/typeparams v0.0.0-20240909161429-701f63a606c0 // indirect
194
194
golang.org/x/mod v0.21.0 // indirect
195
195
golang.org/x/sync v0.8.0 // indirect
196
196
golang.org/x/sys v0.26.0 // indirect
Original file line number Diff line number Diff line change @@ -23,8 +23,8 @@ func New(settings *config.GinkgoLinterSettings) *goanalysis.Linter {
23
23
SuppressTypeCompare : types .Boolean (settings .SuppressTypeCompareWarning ),
24
24
AllowHaveLen0 : types .Boolean (settings .AllowHaveLenZero ),
25
25
ForceExpectTo : types .Boolean (settings .ForceExpectTo ),
26
- ValidateAsyncIntervals : types .Boolean (settings .ForbidSpecPollution ),
27
- ForbidSpecPollution : types .Boolean (settings .ValidateAsyncIntervals ),
26
+ ValidateAsyncIntervals : types .Boolean (settings .ValidateAsyncIntervals ),
27
+ ForbidSpecPollution : types .Boolean (settings .ForbidSpecPollution ),
28
28
}
29
29
}
30
30
Original file line number Diff line number Diff line change @@ -64,10 +64,10 @@ func WrongComparisonUsecase_compare() {
64
64
x := 8
65
65
Expect (x == 8 ).To (BeTrue ())
66
66
Expect (x < 9 ).To (BeTrue ())
67
- Expect (x < 7 ).To (Equal (false ))
67
+ Expect (x < 7 ).To (Equal (false )) // want "ginkgo-linter: wrong boolean assertion. Consider using `Expect\\(x < 7\\)\\.To\\(BeFalse\\(\\)\\)`"
68
68
69
69
p1 , p2 := & x , & x
70
- Expect (p1 == p2 ).To (Equal (true ))
70
+ Expect (p1 == p2 ).To (Equal (true )) // want "ginkgo-linter: wrong boolean assertion. Consider using `Expect\\(p1 == p2\\)\\.To\\(BeTrue\\(\\)\\)`"
71
71
}
72
72
73
73
func slowInt_compare () int {
Original file line number Diff line number Diff line change @@ -49,9 +49,9 @@ func ErrorUsecase_err() {
49
49
funcReturnsErr := func () error { return err }
50
50
51
51
Expect (err ).To (BeNil ())
52
- Expect (err == nil ).To (Equal (true ))
53
- Expect (err == nil ).To (BeFalse ())
54
- Expect (err != nil ).To (BeTrue ())
52
+ Expect (err == nil ).To (Equal (true )) // want "ginkgo-linter: wrong nil assertion. Consider using `Expect\\(err\\).To\\(BeNil\\(\\)\\)`"
53
+ Expect (err == nil ).To (BeFalse ()) // want "ginkgo-linter: wrong nil assertion. Consider using `Expect\\(err\\).ToNot\\(BeNil\\(\\)\\)`"
54
+ Expect (err != nil ).To (BeTrue ()) // want "ginkgo-linter: wrong nil assertion. Consider using `Expect\\(err\\).ToNot\\(BeNil\\(\\)\\)`"
55
55
Expect (funcReturnsErr ()).To (BeNil ())
56
56
}
57
57
Original file line number Diff line number Diff line change @@ -31,9 +31,9 @@ func LenUsecase_nil() {
31
31
func NilUsecase_nil () {
32
32
y := 5
33
33
x := & y
34
- Expect (x == nil ).To (Equal (true ))
35
- Expect (nil == x ).To (Equal (true ))
36
- Expect (x != nil ).To (Equal (true ))
34
+ Expect (x == nil ).To (Equal (true )) // want "ginkgo-linter: wrong boolean assertion. Consider using `Expect\\(x == nil\\).To\\(BeTrue\\(\\)\\)`"
35
+ Expect (nil == x ).To (Equal (true )) // want "ginkgo-linter: wrong boolean assertion. Consider using `Expect\\(nil == x\\).To\\(BeTrue\\(\\)\\)`"
36
+ Expect (x != nil ).To (Equal (true )) // want "ginkgo-linter: wrong boolean assertion. Consider using `Expect\\(x != nil\\).To\\(BeTrue\\(\\)\\)`"
37
37
Expect (x == nil ).To (BeTrue ())
38
38
Expect (x == nil ).To (BeFalse ())
39
39
}
You can’t perform that action at this time.
0 commit comments