Skip to content

chore: enable early-return, if-return and superfluous-else from revive#8640

Closed
mmorel-35 wants to merge 1 commit into
velero-io:mainfrom
mmorel-35:revive/superfluous-else
Closed

chore: enable early-return, if-return and superfluous-else from revive#8640
mmorel-35 wants to merge 1 commit into
velero-io:mainfrom
mmorel-35:revive/superfluous-else

Conversation

@mmorel-35
Copy link
Copy Markdown
Contributor

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

Thank you for contributing to Velero!

Please add a summary of your change

enables and fixes this rules from revive

Enable preserveScope for indent-error-flow to not suggest refactorings that would increase variable scope.

Does your change fix a particular issue?

Fixes #(issue)

Please indicate you've done the following:

@mmorel-35
Copy link
Copy Markdown
Contributor Author

/kind changelog-not-required

@github-actions github-actions Bot added the kind/changelog-not-required PR does not require a user changelog. Often for docs, website, or build changes label Jan 22, 2025
@mmorel-35 mmorel-35 force-pushed the revive/superfluous-else branch 2 times, most recently from 76702e6 to f01c93f Compare January 22, 2025 18:11
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 22, 2025

Codecov Report

❌ Patch coverage is 83.20000% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.70%. Comparing base (6085044) to head (fc24af1).
⚠️ Report is 103 commits behind head on main.

Files with missing lines Patch % Lines
internal/volume/volumes_information.go 92.74% 7 Missing and 2 partials ⚠️
pkg/uploader/kopia/block_restore.go 0.00% 5 Missing ⚠️
pkg/cmd/server/server.go 50.00% 3 Missing ⚠️
pkg/controller/restore_controller.go 72.72% 2 Missing and 1 partial ⚠️
pkg/repository/maintenance/maintenance.go 0.00% 3 Missing ⚠️
pkg/restore/restore.go 40.00% 2 Missing and 1 partial ⚠️
pkg/util/csi/volume_snapshot.go 40.00% 3 Missing ⚠️
pkg/backup/actions/csi/pvc_action.go 94.73% 1 Missing ⚠️
pkg/client/retry.go 0.00% 1 Missing ⚠️
pkg/controller/data_download_controller.go 66.66% 1 Missing ⚠️
... and 10 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8640      +/-   ##
==========================================
+ Coverage   59.67%   59.70%   +0.03%     
==========================================
  Files         381      381              
  Lines       43879    43787      -92     
==========================================
- Hits        26186    26145      -41     
+ Misses      16147    16109      -38     
+ Partials     1546     1533      -13     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mmorel-35 mmorel-35 force-pushed the revive/superfluous-else branch from f01c93f to 7863522 Compare February 7, 2025 09:36
blackpiglet
blackpiglet previously approved these changes Feb 7, 2025
@mmorel-35 mmorel-35 force-pushed the revive/superfluous-else branch from 7863522 to 2973e3c Compare February 11, 2025 07:16
@mmorel-35 mmorel-35 force-pushed the revive/superfluous-else branch from 2973e3c to 7162b91 Compare February 19, 2025 19:09
@mmorel-35 mmorel-35 marked this pull request as draft February 26, 2025 19:23
@mmorel-35 mmorel-35 force-pushed the revive/superfluous-else branch from 7162b91 to a34576c Compare March 14, 2025 06:37
@mmorel-35 mmorel-35 force-pushed the revive/superfluous-else branch 3 times, most recently from 5abdf92 to 5a9fa67 Compare March 14, 2025 06:49
@mmorel-35 mmorel-35 marked this pull request as ready for review March 14, 2025 06:56
@github-actions github-actions Bot requested a review from reasonerjt March 14, 2025 06:56
@mmorel-35 mmorel-35 force-pushed the revive/superfluous-else branch 2 times, most recently from 8e897d4 to a3ac48f Compare March 14, 2025 07:19
@mmorel-35 mmorel-35 marked this pull request as draft March 14, 2025 07:19
@mmorel-35 mmorel-35 force-pushed the revive/superfluous-else branch from a3ac48f to 9fe6681 Compare March 14, 2025 07:25
@mmorel-35 mmorel-35 marked this pull request as ready for review March 14, 2025 07:50
@github-actions github-actions Bot requested a review from Lyndon-Li March 14, 2025 07:50
@mmorel-35 mmorel-35 force-pushed the revive/superfluous-else branch from 9fe6681 to 199870c Compare April 12, 2025 12:15
@mmorel-35 mmorel-35 force-pushed the revive/superfluous-else branch from 199870c to c81b7a1 Compare April 20, 2025 08:38
@mmorel-35 mmorel-35 force-pushed the revive/superfluous-else branch from a962937 to 880bcb6 Compare June 23, 2025 08:08
@mmorel-35
Copy link
Copy Markdown
Contributor Author

OK, I provided comments and links for each new rule

kaovilai
kaovilai previously approved these changes Jun 23, 2025
@blackpiglet blackpiglet force-pushed the revive/superfluous-else branch from 880bcb6 to 573e47f Compare June 24, 2025 02:40
@mmorel-35 mmorel-35 force-pushed the revive/superfluous-else branch from 573e47f to c15cea3 Compare June 24, 2025 05:20
@mmorel-35 mmorel-35 force-pushed the revive/superfluous-else branch from c15cea3 to c9b0065 Compare June 26, 2025 06:08
@kaovilai
Copy link
Copy Markdown
Collaborator

LGTM - purely stylistic linter refactoring with no logical changes.

@mmorel-35 mmorel-35 force-pushed the revive/superfluous-else branch 4 times, most recently from 22ca2fa to 490bb4c Compare July 17, 2025 21:28
kaovilai
kaovilai previously approved these changes Jul 17, 2025
@mmorel-35 mmorel-35 force-pushed the revive/superfluous-else branch from c908ce9 to 11afa16 Compare July 21, 2025 21:13
kaovilai
kaovilai previously approved these changes Jul 21, 2025
@mmorel-35 mmorel-35 force-pushed the revive/superfluous-else branch from 11afa16 to 178c3e1 Compare July 22, 2025 05:37
@mmorel-35 mmorel-35 force-pushed the revive/superfluous-else branch 5 times, most recently from 44931c5 to 2960183 Compare July 25, 2025 06:49
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
@mmorel-35 mmorel-35 force-pushed the revive/superfluous-else branch from 2960183 to fc24af1 Compare August 9, 2025 21:42
@mmorel-35 mmorel-35 closed this Oct 19, 2025
@mmorel-35 mmorel-35 deleted the revive/superfluous-else branch October 19, 2025 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

has-e2e-2tests has-unit-tests kind/changelog-not-required PR does not require a user changelog. Often for docs, website, or build changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants