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

[chore]: enable negative-positive rule from testifylint #5849

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

mmorel-35
Copy link
Contributor

@mmorel-35 mmorel-35 commented Sep 26, 2024

Description

Testifylint is a linter that provides best practices with the use of testify.

This PR enables negative-positive rule from testifylint

Copy link
Member

@pellared pellared left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like assert.Equal is correct in almost all places (except one).

exporters/prometheus/exporter_test.go Outdated Show resolved Hide resolved
log/keyvalue_test.go Outdated Show resolved Hide resolved
log/keyvalue_test.go Outdated Show resolved Hide resolved
metric/asyncfloat64_test.go Outdated Show resolved Hide resolved
sdk/metric/aggregation_test.go Outdated Show resolved Hide resolved
sdk/metric/internal/exemplar/value_test.go Outdated Show resolved Hide resolved
@mmorel-35
Copy link
Contributor Author

@pellared ,

I believ it's probably better to keep float-compare disabled in that case.
What do you think ?

@pellared
Copy link
Member

pellared commented Sep 27, 2024

@pellared ,

I believ it's probably better to keep float-compare disabled in that case. What do you think ?

I agree.

However, you can keep the assert.InDelta(t, tt.expected.sum, dp.sum, 0.01) change.

@mmorel-35 mmorel-35 force-pushed the testifylint/float-compare branch 2 times, most recently from d851ce9 to 93c0832 Compare September 27, 2024 18:59
Copy link

codecov bot commented Sep 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.5%. Comparing base (481f498) to head (21adde1).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #5849   +/-   ##
=====================================
  Coverage   84.5%   84.5%           
=====================================
  Files        272     272           
  Lines      22734   22734           
=====================================
+ Hits       19225   19226    +1     
+ Misses      3166    3165    -1     
  Partials     343     343           

see 1 file with indirect coverage changes

@mmorel-35 mmorel-35 requested a review from pellared September 27, 2024 19:02
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
@mmorel-35 mmorel-35 force-pushed the testifylint/float-compare branch from 93c0832 to 21adde1 Compare September 27, 2024 19:02
@pellared pellared changed the title [chore]: enable float-compare and negative-positive rules from testifylint [chore]: enable negative-positive rules from testifylint Sep 27, 2024
@mmorel-35 mmorel-35 changed the title [chore]: enable negative-positive rules from testifylint [chore]: enable negative-positive rule from testifylint Sep 27, 2024
@pellared pellared merged commit 469f3d7 into open-telemetry:main Sep 30, 2024
32 checks passed
@mmorel-35 mmorel-35 deleted the testifylint/float-compare branch September 30, 2024 06:51
@MrAlias MrAlias added this to the v1.31.0 milestone Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants