nunnatsa / ginkgolinter

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

Fix bug in comparison rule #73

Closed nunnatsa closed 1 year ago

nunnatsa commented 1 year ago

Description

When comparing len() result with a number, the linter used to wrongly fix Expect(len(x) == 5).To(BeTrue()) to Expect(len(x)).To(Equal(5)), which is also a wrong pattern.

This PR fixes this bug and fix the wrong patter to Expect(x).To(HaveLen(5))

Note: this is only for equal or not-equal comparison.

Type of change

How Has This Been Tested?

Checklist:

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 4468430270


Changes Missing Coverage Covered Lines Changed/Added Lines %
ginkgo_linter.go 33 43 76.74%
<!-- Total: 33 43 76.74% -->
Totals Coverage Status
Change from base Build 4468363662: 0.2%
Covered Lines: 698
Relevant Lines: 839

💛 - Coveralls