nunnatsa / ginkgolinter

golang linter for ginkgo and gomega
MIT License
25 stars 6 forks source link

Add check for wrong error assertion #27

Closed nunnatsa closed 2 years ago

nunnatsa commented 2 years ago

Check these patterns: Expect(err).To(Equal(nil)) Expect(err).To(BeNil()) Expect(err == nil).To(BeTrue/BeFalse()) Expect(err == nil).To(Equal(true/false))

Support new suppress comment: ginkgo-linter:ignore-err-assert-warning

Support new parameter: --suppress-err-assertion

Also, added more nil check: Expect(x).To(Equal(nil))

Refactoring: move many things to new packages to reduce the code size in ginkgo_linter.go and make it more readable.

coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 2689835294

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
ginkgo_linter.go 149 167 89.22%
types/suppress.go 10 34 29.41%
<!-- Total: 213 255 83.53% -->
Totals Coverage Status
Change from base Build 2684578225: -0.1%
Covered Lines: 466
Relevant Lines: 538

💛 - Coveralls