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 early-return and superfluous-else from revive #19152

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mmorel-35
Copy link
Contributor

@mmorel-35 mmorel-35 commented Jan 9, 2025

Description

early-return: In Go it is idiomatic to minimize nesting statements, a typical example is to avoid if-then-else constructions.

superfluous-else: To improve the readability of code, it is recommended to reduce the indentation as much as possible. This rule highlights redundant else-blocks that can be eliminated from the code.

Copy link

codecov bot commented Jan 9, 2025

Codecov Report

Attention: Patch coverage is 52.94118% with 8 lines in your changes missing coverage. Please review.

Project coverage is 68.74%. Comparing base (ecd7cfc) to head (10d7cea).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
server/etcdserver/api/v2store/store.go 33.33% 2 Missing and 2 partials ⚠️
etcdctl/ctlv3/command/check.go 0.00% 3 Missing ⚠️
etcdctl/ctlv3/ctl.go 0.00% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
pkg/flags/selective_string.go 100.00% <100.00%> (ø)
server/etcdserver/cluster_util.go 66.17% <100.00%> (-0.13%) ⬇️
server/proxy/grpcproxy/watcher.go 91.83% <100.00%> (-0.17%) ⬇️
server/storage/mvcc/watchable_store.go 93.89% <100.00%> (-0.02%) ⬇️
etcdctl/ctlv3/ctl.go 0.00% <0.00%> (ø)
etcdctl/ctlv3/command/check.go 0.00% <0.00%> (ø)
server/etcdserver/api/v2store/store.go 83.87% <33.33%> (-0.05%) ⬇️

... and 24 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #19152      +/-   ##
==========================================
- Coverage   68.76%   68.74%   -0.02%     
==========================================
  Files         420      420              
  Lines       35650    35641       -9     
==========================================
- Hits        24513    24500      -13     
+ Misses       9714     9706       -8     
- Partials     1423     1435      +12     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ecd7cfc...10d7cea. Read the comment docs.

@mmorel-35 mmorel-35 force-pushed the revive/superfluous-else branch from 1180239 to 35d0e02 Compare January 15, 2025 19:41
@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahrtr, mmorel-35

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mmorel-35 mmorel-35 force-pushed the revive/superfluous-else branch 2 times, most recently from f328a9f to 8f37a26 Compare January 17, 2025 22:00
etcdctl/ctlv3/ctl.go Outdated Show resolved Hide resolved
Signed-off-by: Matthieu MOREL <[email protected]>

Co-authored-by: Iván Valdés Castillo <[email protected]>
@mmorel-35 mmorel-35 force-pushed the revive/superfluous-else branch from 40e8073 to 10d7cea Compare January 18, 2025 08:45
@mmorel-35 mmorel-35 requested a review from ivanvc January 18, 2025 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants