linter: unused-parameter - #832
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
@coderabbitai review |
✅ Action performedReview finished.
|
📝 WalkthroughWalkthroughThe change replaces unused Go callback and method parameters with blank identifiers across CLI, command, filesystem, credential, production, and test code. Filesystem ignore-list and internal copy handling also change in ChangesParameter cleanup and filesystem utilities
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pkg/util/fs_util.go (1)
973-984: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winPreserve
FileContextexclusions inCopyFileInternal.Ignoring this parameter removes the exclusion behavior previously applied by this copy path. Any non-empty
FileContextcan now result in an excluded source being created at the destination; this is a behavioral regression, not merely unused-parameter cleanup.Restore the
context.ExcludesFile(src)guard, matchingCopyFile, before opening or creating the destination.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/util/fs_util.go` around lines 973 - 984, Restore FileContext handling in CopyFileInternal by naming the parameter and checking context.ExcludesFile(src) before opening the source or creating the destination; return without copying when the source is excluded, matching CopyFile behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/util/fs_util.go`:
- Around line 549-552: Update CheckCleanedPathAgainstProvidedIgnoreList to
iterate over its caller-provided ignore list parameter instead of the
package-level ignorelist, preserving the existing prefix-match logic and return
behavior.
---
Outside diff comments:
In `@pkg/util/fs_util.go`:
- Around line 973-984: Restore FileContext handling in CopyFileInternal by
naming the parameter and checking context.ExcludesFile(src) before opening the
source or creating the destination; return without copying when the source is
excluded, matching CopyFile behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 6e236235-602e-49a0-91a4-79db848e7c9b
📒 Files selected for processing (27)
cmd/executor/cmd/root.gocmd/executor/cmd/root_test.gocmd/executor/cmd/version.gocmd/warmer/cmd/root.gointegration/tar.gopkg/buildcontext/https_test.gopkg/commands/add.gopkg/commands/cmd.gopkg/commands/copy.gopkg/commands/copy_test.gopkg/commands/entrypoint.gopkg/commands/healthcheck.gopkg/commands/onbuild.gopkg/commands/run.gopkg/commands/run_test.gopkg/commands/shell.gopkg/commands/workdir_test.gopkg/creds/env_keychain.gopkg/dockerfile/dockerfile.gopkg/executor/build_test.gopkg/executor/fakes_test.gopkg/executor/push_test.gopkg/image/image_util_test.gopkg/image/remote/remote_test.gopkg/snapshot/snapshot.gopkg/util/fs_util.gopkg/util/transport_util_test.go
Carves the unused-parameter cleanup out of #539. Unused named function parameters are renamed to
_(e.g. the cobraRun: func(_ *cobra.Command, _ []string)handlers), as flagged by revive's unused-parameter rule. Purely mechanical and behaviour-preserving. The rule itself is not enabled in the config here, that stays in #539, so this is a code cleanup with no CI change.Summary by CodeRabbit
Refactor
Tests