Tags: nunnatsa/ginkgolinter
Tags
Bump golang.org/x/tools from 0.15.0 to 0.16.0 Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.15.0 to 0.16.0. - [Release notes](https://github.com/golang/tools/releases) - [Commits](golang/tools@v0.15.0...v0.16.0) --- updated-dependencies: - dependency-name: golang.org/x/tools dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
Fix issue with comparing different types and WithTransform The bug is that when checking the comparison of two different types, if the matcher is `WithTransform`, ginkgo linter does not check the nested matcher, causing false positive for any matcher other than `Equal` or `BeIdentical`. This PR fixes this issue by checking the nested matcher name, and only trigger error if the nested matcher is `Equal` or `BeIdentical`.
Fix the compare different type rule, to allow using WithTransform The `WithTransform` matcher can be used to transform the actual value type. This PR fix a false positive when using this matcher to change the actual value type to match the matcher type. For example: ```go Expect(uint(5)).Should(WithTransform(func(i uint) int { return int(i) }, Equal(5))) ``` In this case, the test should work because the transform function (the first parameter of the `WithTransform` matcher) casts the `uint` actual value to `int`, to match the `Equal(5)` matcher.
PreviousNext