nunnatsa / ginkgolinter

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

Add new linter rule: Compare pointer to value #78

Closed nunnatsa closed 1 year ago

nunnatsa commented 1 year ago

Description

The linter warns when comparing a pointer with a value. These comparisons are always wrong and will always fail.

For example:

num := 5
...
pNum := &num
...
Expect(pNum).ShouldNot(Equal(6))

The linter will suggest to use this instead:

Expect(pNum).ShouldNot(HaveValue(Equal(6)))

Fixes #76

Type of change

How Has This Been Tested?

Checklist:

@BorzdeG

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 4587736517


Changes Missing Coverage Covered Lines Changed/Added Lines %
ginkgo_linter.go 80 90 88.89%
<!-- Total: 80 90 88.89% -->
Totals Coverage Status
Change from base Build 4525032112: 0.2%
Covered Lines: 797
Relevant Lines: 947

💛 - Coveralls