-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[chore]: enable float-compare rule from testifylint #35167
Conversation
ff882f1
to
26bcf60
Compare
26bcf60
to
68939f0
Compare
68939f0
to
db2ca6e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems unlikely that 0.01
is an appropriate level of precision for every float comparison across all tests in the codebase.
For example, in one instance we were validating the number 3.15759539000001e+08
exactly (which presumably reflects an intended value of 3.15759539e+08
), but now we would be passing it if it were 3.166
or 3.148
I think we need to try to ascertain an intended level of precision on a case by case basis, and short of that we should not adopt the linter if the current code is not causing problems.
I can drop this PR and the other on opentelemetry-collector and focus on other rules if you want? |
I'm open to other opinions but mine is that this linter doesn't provide much value unless we're encountering problems from not using it. |
f5c9b70
to
e1785be
Compare
3cf7232
to
52b8f49
Compare
fdceb2b
to
a51e559
Compare
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
a51e559
to
64e4088
Compare
Description
Testifylint is a linter that provides best practices with the use of testify.
This PR enables float-compare rule from testifylint