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

Enable Lint Rules: bare-return & empty-lines #5512

Merged
merged 5 commits into from
Jun 3, 2024

Conversation

FlamingSaint
Copy link
Member

@FlamingSaint FlamingSaint commented Jun 3, 2024

Which problem is this PR solving?

Description of the changes

  • Enabled bare-return in revive linter.
  • Removed naked returns.
  • Enabled empty-lines in revive linter.

How was this change tested?

  • make lint make test

Checklist

Signed-off-by: FlamingSaint <[email protected]>
@FlamingSaint FlamingSaint requested a review from a team as a code owner June 3, 2024 02:28
Copy link

codecov bot commented Jun 3, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 96.19%. Comparing base (c428138) to head (2c7c15f).

Files Patch % Lines
pkg/kafka/auth/plaintext.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5512       +/-   ##
===========================================
+ Coverage   54.23%   96.19%   +41.95%     
===========================================
  Files         161      327      +166     
  Lines        8369    16011     +7642     
===========================================
+ Hits         4539    15401    +10862     
+ Misses       3384      435     -2949     
+ Partials      446      175      -271     
Flag Coverage Δ
badger_v1 8.05% <0.00%> (+<0.01%) ⬆️
badger_v2 ?
cassandra-3.x-v1 16.43% <0.00%> (+<0.01%) ⬆️
cassandra-3.x-v2 1.85% <0.00%> (+<0.01%) ⬆️
cassandra-4.x-v1 16.43% <0.00%> (+<0.01%) ⬆️
cassandra-4.x-v2 1.85% <0.00%> (+<0.01%) ⬆️
elasticsearch-7-v1 18.89% <0.00%> (+<0.01%) ⬆️
elasticsearch-8-v1 19.08% <0.00%> (+<0.01%) ⬆️
elasticsearch-8-v2 19.08% <0.00%> (+<0.01%) ⬆️
grpc_v1 9.48% <0.00%> (+<0.01%) ⬆️
grpc_v2 ?
kafka 9.78% <0.00%> (+<0.01%) ⬆️
opensearch-1-v1 18.94% <0.00%> (+<0.01%) ⬆️
opensearch-2-v1 18.93% <0.00%> (+<0.01%) ⬆️
opensearch-2-v2 18.93% <0.00%> (-0.01%) ⬇️
unittests 93.88% <66.66%> (?)

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.

@@ -149,5 +149,5 @@ func (r *requestDurations) buildTimer(metricsFactory metrics.Factory, key record
"method": key.method,
},
})
return
return out
Copy link
Member

Choose a reason for hiding this comment

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

We can remove the name "out" from the signature

Copy link
Member Author

Choose a reason for hiding this comment

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

The defer function on top requires the named output as its assigning a value to it

pkg/kafka/auth/plaintext.go Outdated Show resolved Hide resolved
pkg/kafka/auth/plaintext.go Outdated Show resolved Hide resolved
pkg/gzipfs/gzip.go Show resolved Hide resolved
@yurishkuro yurishkuro added the changelog:ci Change related to continuous integration / testing label Jun 3, 2024
@FlamingSaint FlamingSaint changed the title Enable Lint Rule: bare-return Enable Lint Rules: bare-return & empty-lines Jun 3, 2024
@yurishkuro yurishkuro merged commit bd33dc2 into jaegertracing:main Jun 3, 2024
39 of 40 checks passed
@FlamingSaint FlamingSaint deleted the lint-bare-return branch June 3, 2024 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:ci Change related to continuous integration / testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants