Remove unused/dead code from cli - #52
Closed
mohit-nagaraj wants to merge 1 commit into
Closed
mohit-nagaraj wants to merge 1 commit into
mohit-nagaraj wants to merge 1 commit into
Conversation
Deleted: - cmd/config.go: removeProjectConfig() (marked nolint:unused, never called) - tests/mocks/exec_mock.go (never imported) - test/docker-install-test.sh (not in CI, has wrong npm scope) - npm/index.js (exported binPath never imported, bin entry sufficient) - npm/scripts/prepack.js (no-op script) - tests/helpers/test_helpers.go: CaptureOutput() (never called) - tests/unit/utils_test.go: TestValidateDockerCompose, TestJoinArgs (placeholder tests with no real assertions) Updated: - package.json: removed prepack script and main field (CLI-only package) - tests/helpers/test_helpers.go: removed unused io import Skipped: - cmd/testing.go: testDefaultUIRepo/testDefaultCoreRepo still used as NoOptDefVal for flag defaults Tests pass: go build ./... and go test ./cmd/... both succeed Co-authored-by: Mohit Nagaraj <me@mohitnagaraj.in>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Closing this — the nightly audit was retired. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes unused and dead code from the KubeOrch CLI codebase. All items were verified as truly unused before deletion.
What was deleted
Code deletions
cmd/config.go:removeProjectConfig()function (markednolint:unused, never called)tests/mocks/exec_mock.go: entire file (never imported anywhere)test/docker-install-test.sh: broken test script (not in CI, references wrong npm scope@kubeorch/clivs@kubeorchestra/cli)npm/index.js: module export file (exportedbinPathnever imported; bin entry in package.json is sufficient)npm/scripts/prepack.js: no-op prepack script (just logs messages, does no actual work)tests/helpers/test_helpers.go:CaptureOutput()function (never called)tests/unit/utils_test.go:TestValidateDockerCompose()andTestJoinArgs()(placeholder tests with mock assertions only)Package.json updates
prepackscript referencemainfield (CLI-only package, only needsbinentry)ioimport from test helpersWhat was skipped
cmd/testing.go:testDefaultUIRepoandtestDefaultCoreRepoconstants — still used asNoOptDefValfor flag defaults (lines 64-65)Verification
✅
go build ./...passes✅
go test ./cmd/...passes (all cmd package tests green)Impact
Pure subtraction — smaller surface area, no functional changes.