v0.10.0 #75
nunnatsa
announced in
Announcements
v0.10.0
#75
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This new version brings some new additions:
New Linter Rule:
Function Call in async assertions
The linter now warns about using
Eventually
orConsistently
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:
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:
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 theginkgo-linter:ignore-async-assert-warning
comment.Improvements and Bug Fixes
Bug Fix: len() comparison
When comparing len() result with a number; e.g.
the linter used to wrongly fix suggested to replace to
which is also a wrong pattern.
Now, the linter will suggest:
Avoid double negative assertions
For patterns like
or
the linter will suggest
Support the WithOffset() method
The linter used to ignore patterns like
Now, the linter will catch these patterns as well. For the above code, the linter will suggest
This discussion was created from the release v0.10.0.
Beta Was this translation helpful? Give feedback.
All reactions