Closed nunnatsa closed 8 months ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
ginkgo_linter.go | 88 | 95 | 92.63% | ||
<!-- | Total: | 89 | 96 | 92.71% | --> |
Totals | |
---|---|
Change from base Build 6681659461: | 0.5% |
Covered Lines: | 1102 |
Relevant Lines: | 1305 |
Description
The
MatchError
gomega matcher asserts an error value (and if it's not nil).There are four valid formats for using this Matcher:
Expect(err).To(MatchError(anotherErr))
Error()
method; e.g.Expect(err).To(MatchError("Not Found"))
Expect(err).To(MatchError(ContainSubstring("Found")))
Expect(err).To(MatchError(isNotFound, "is the error is a not found error"))
These four format are checked on runtime, but sometimes it's too late. ginkgolinter performs a static analysis and so it will find these issues on build time.
ginkgolinter checks the following:
MatchError(isNotFoundFunc, "a valid description" , "not used string")
. In this case, the matcher won't fail on run time, but the additional parameters are not in use and ignored.func(error)bool
, ginkgolinter makes sure that the second parameter exists and its type is string.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist:
Fix #114