Skip to content

Conversation

@julio-lopez
Copy link
Collaborator

There has been controversy in the community about the use of naked return statements.
Given that two linters (nakedret and soon gofumpt) flag these, and gofumpt does not have a configuration option for it, it makes sense to have explicit return values, for clarity, in the few instances where they are missing.

@julio-lopez julio-lopez requested a review from Copilot October 31, 2025 05:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the codebase to replace naked return statements with explicit return values for improved code clarity and to satisfy linter requirements (nakedret and gofumpt).

  • Replaced naked return statements with explicit return values across multiple files
  • Removed associated //nolint:nakedret comments that are no longer needed
  • Maintained the same function behavior while improving code readability

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/robustness/snapmeta/kopia_snapshotter.go Added explicit returns for snapshot creation and restoration functions
tests/robustness/robustness_test/main_test.go Added explicit return for cleanup function
tests/robustness/engine/action.go Added explicit returns for file operation action functions
snapshot/policy/retention_policy.go Added explicit return for string prefix/suffix parsing function
repo/ecc/ecc_utils.go Added explicit return for shard computation function
repo/ecc/ecc_rs_crc.go Added explicit return for length reading function and removed nolint comment
repo/content/indexblob/index_blob_manager_v0.go Added explicit return for blob deletion finding function
repo/blob/sharded/sharded.go Added explicit returns for sharded path resolution function
repo/blob/sftp/sftp_storage_test.go Added explicit returns for SFTP server startup test function and removed nolint comments

@codecov
Copy link

codecov bot commented Oct 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.00%. Comparing base (cb455c6) to head (9570738).
⚠️ Report is 723 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4940      +/-   ##
==========================================
+ Coverage   75.86%   78.00%   +2.13%     
==========================================
  Files         470      540      +70     
  Lines       37301    31268    -6033     
==========================================
- Hits        28299    24391    -3908     
+ Misses       7071     4833    -2238     
- Partials     1931     2044     +113     

☔ 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.

@julio-lopez julio-lopez marked this pull request as ready for review October 31, 2025 06:13
@julio-lopez julio-lopez merged commit 069018a into kopia:master Oct 31, 2025
27 checks passed
@julio-lopez julio-lopez deleted the refactor/explicit-ret-vals branch October 31, 2025 06:15
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.

1 participant