Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump github.com/nunnatsa/ginkgolinter from 0.9.0 to 0.10.0 #3734

Merged

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Mar 26, 2023

Bumps github.com/nunnatsa/ginkgolinter from 0.9.0 to 0.10.0.

Release notes

Sourced from github.com/nunnatsa/ginkgolinter's releases.

v0.10.0

This new version brings some new additions:

New Linter Rule:

Function Call in async assertions

The linter now warns about using Eventually or Consistently with a function call. This is because when doing that, Eventually checks the same returned value again and again, instead of polling by calling the function.

For example:

func slowInt() int {
	time.Sleep(time.Second)
	return 42
}
It("should test that slowInt returns 42, eventually", func() {
Eventually(slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Equal(42)
})

In the above code, Eventually receives 42 as its argument. Then it polls this value to check if it equal 42. What we really wanted here is:

It("should test that slowInt returns 42, eventually", func() {
	Eventually(slowInt).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Equal(42)
})

Now, Eventually calls the function until it returns the required value.

Note: The linter ignores function calls that return a function or a channel.

To suppress this warning entirely, add the --suppress-async-assertion=true command line flag, or the ginkgo-linter:ignore-async-assert-warning comment.

Improvements and Bug Fixes

Bug Fix: len() comparison

When comparing len() result with a number; e.g.

Expect(len(x) == 5).Should(BeTrue())

the linter used to wrongly fix suggested to replace to

Expect(len(x)).To(Equal(5))

which is also a wrong pattern.

Now, the linter will suggest:

Expect(x).To(HaveLen(5))

Avoid double negative assertions

For patterns like

Expect(boolVal).ShouldNot(Equal(false))
</tr></table> 

... (truncated)

Commits
  • 8fdd05e Add new rule: function call in async assertions
  • e383a0e Fix bug in comparison rule
  • 349d18a Avoid double negative assertions
  • 7295659 Support the WithOffset method
  • 42180a1 Bump golang.org/x/tools from 0.6.0 to 0.7.0
  • See full diff in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [github.com/nunnatsa/ginkgolinter](https://github.com/nunnatsa/ginkgolinter) from 0.9.0 to 0.10.0.
- [Release notes](https://github.com/nunnatsa/ginkgolinter/releases)
- [Commits](nunnatsa/ginkgolinter@v0.9.0...v0.10.0)

---
updated-dependencies:
- dependency-name: github.com/nunnatsa/ginkgolinter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Relates to an upstream dependency go Pull requests that update Go code labels Mar 26, 2023
@ldez ldez added the linter: update version Update version of linter label Mar 26, 2023
@ldez ldez merged commit ba0a69c into master Mar 26, 2023
@ldez ldez deleted the dependabot/go_modules/github.com/nunnatsa/ginkgolinter-0.10.0 branch March 26, 2023 15:20
SeigeC pushed a commit to SeigeC/golangci-lint that referenced this pull request Apr 4, 2023
@ldez ldez added this to the v1.53 milestone Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Relates to an upstream dependency go Pull requests that update Go code linter: update version Update version of linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant