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 err-error and errorf rules from perfsprint linter #6160

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

mmorel-35
Copy link
Contributor

@mmorel-35 mmorel-35 commented Nov 4, 2024

Which problem is this PR solving?

Description of the changes

  • enable err-error and errorf rules from perfsprint linter
  • Uses errors.New instead of fmt.Errorf when there is only one argument

How was this change tested?

  • CI

Checklist

@mmorel-35 mmorel-35 requested a review from a team as a code owner November 4, 2024 19:18
@mmorel-35
Copy link
Contributor Author

/cc @ChengenH

Copy link

codecov bot commented Nov 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.49%. Comparing base (74ec19a) to head (410bdda).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6160      +/-   ##
==========================================
+ Coverage   96.47%   96.49%   +0.01%     
==========================================
  Files         354      354              
  Lines       20126    20126              
==========================================
+ Hits        19417    19420       +3     
+ Misses        524      522       -2     
+ Partials      185      184       -1     
Flag Coverage Δ
badger_v1 8.31% <0.00%> (ø)
badger_v2 1.67% <0.00%> (ø)
cassandra-4.x-v1 14.39% <0.00%> (ø)
cassandra-4.x-v2 1.61% <0.00%> (ø)
cassandra-5.x-v1 14.39% <0.00%> (ø)
cassandra-5.x-v2 1.61% <0.00%> (ø)
elasticsearch-6.x-v1 18.59% <0.00%> (ø)
elasticsearch-7.x-v1 18.68% <0.00%> (+<0.01%) ⬆️
elasticsearch-8.x-v1 18.85% <0.00%> (ø)
elasticsearch-8.x-v2 1.67% <0.00%> (ø)
grpc_v1 9.48% <0.00%> (+<0.01%) ⬆️
grpc_v2 6.99% <0.00%> (ø)
kafka-v1 8.88% <0.00%> (ø)
kafka-v2 1.67% <0.00%> (ø)
memory_v2 1.67% <0.00%> (+0.01%) ⬆️
opensearch-1.x-v1 18.73% <0.00%> (ø)
opensearch-2.x-v1 18.72% <0.00%> (-0.01%) ⬇️
opensearch-2.x-v2 1.66% <0.00%> (-0.02%) ⬇️
tailsampling-processor 0.46% <0.00%> (ø)
unittests 95.40% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

🎉

"testing"

"github.com/olivere/elastic"
"github.com/stretchr/testify/require"
)

func TestDetailedError(t *testing.T) {
require.ErrorContains(t, fmt.Errorf("some err"), "some err", "no panic")
require.ErrorContains(t, errors.New("some err"), "some err", "no panic")
Copy link
Member

Choose a reason for hiding this comment

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

No idea what this is trying to do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe testing testify. I don’t see any other reason yet

@yurishkuro yurishkuro merged commit c65757f into jaegertracing:main Nov 4, 2024
50 of 51 checks passed
@mmorel-35 mmorel-35 deleted the golangci-lint/perfsprint branch November 4, 2024 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants