Skip to content

Commit

Permalink
Add more test case to increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
nunnatsa committed Jul 12, 2022
1 parent d0ff87d commit 40263d5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
3 changes: 0 additions & 3 deletions ginkgo_linter.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ func (l *ginkgoLinter) run(pass *analysis.Pass) (interface{}, error) {

if comments, ok := cm[stmt]; ok {
exprSuppress.updateFromComment(comments)
if exprSuppress.allTrue() {
return true
}
}

// search for function calls
Expand Down
21 changes: 21 additions & 0 deletions testdata/src/a/suppress/e.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package suppress

// ginkgo-linter:ignore-len-assert-warning
// ginkgo-linter:ignore-nil-assert-warning

import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("suppress file", func() {
var x *int
It("should ignore length warning", func() {
Expect(len("abcd")).Should(Equal(4))
Expect(len("abcd")).ShouldNot(BeZero())
})
It("should ignore nil warning", func() {
Expect(x == nil).Should(Equal(true))
Expect(x == nil).ShouldNot(BeTrue())
})
})

0 comments on commit 40263d5

Please sign in to comment.