Skip to content

refactor: remove dead code and stale references#2691

Merged
louisgv merged 2 commits intomainfrom
qa/code-quality
Mar 16, 2026
Merged

refactor: remove dead code and stale references#2691
louisgv merged 2 commits intomainfrom
qa/code-quality

Conversation

@la14-1
Copy link
Member

@la14-1 la14-1 commented Mar 16, 2026

Summary

  • Removed a stale empty section header // ─── Swap Space Setup from packages/cli/src/shared/agent-setup.ts that had no associated code between it and the next section header. Swap space setup logic was moved to per-cloud getCloudInitUserdata() functions in aws.ts, hetzner.ts, etc., but the empty placeholder header was left behind.

Scan Results

a) Dead code: No dead functions found — all private functions in sh/shared/ and packages/cli/src/ are called.

b) Stale references: One stale empty section header removed from agent-setup.ts. All shell script source calls use absolute paths or ${REPO_ROOT} — no relative path issues.

c) Python usage: None found — no python3 -c or python -c calls in any shell scripts.

d) Duplicate utilities: getCloudInitUserdata() appears in aws.ts, hetzner.ts, and digitalocean.ts but has meaningful per-cloud differences (swap setup, PATH config, user accounts) — not safe to deduplicate.

e) Stale comments: One stale section header removed (see above). The PKCE migration TODO in digitalocean.ts is current and intentional (last verified 2026-03).

Test plan

  • bun test — 1421 pass, 0 fail
  • bunx @biomejs/biome check src/ — no errors
  • bash -n on all modified .sh files — all pass (no .sh files modified)

🤖 Generated with Claude Code

Remove stale '// --- Swap Space Setup' section header from agent-setup.ts
that had no associated code. Swap space setup was moved to cloud init
userdata scripts (aws.ts, hetzner.ts etc.) but the empty section header
was left behind.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Member

@louisgv louisgv left a comment

Choose a reason for hiding this comment

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

Security Review

Verdict: APPROVED
Commit: 464d66f

Findings

No security concerns. This is a cosmetic change that removes a stale comment header ('Swap Space Setup') that had no associated code. The commit message correctly explains that swap space setup was moved to cloud init userdata scripts.

Tests

  • bash -n: N/A (no shell script changes)
  • bun test: PASS (1421/1421 tests passing)
  • lint: PASS (@biomejs/biome reports no issues)
  • curl|bash: N/A (no download scripts modified)
  • macOS compat: N/A (no shell script changes)

-- security/pr-reviewer

@louisgv louisgv merged commit 9e627df into main Mar 16, 2026
5 checks passed
@louisgv louisgv deleted the qa/code-quality branch March 16, 2026 12:53
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.

2 participants