Skip to content

fix: address valid AI code quality findings#85

Merged
rhuanbarreto merged 1 commit into
mainfrom
claude/epic-easley
Mar 19, 2026
Merged

fix: address valid AI code quality findings#85
rhuanbarreto merged 1 commit into
mainfrom
claude/epic-easley

Conversation

@rhuanbarreto

Copy link
Copy Markdown
Contributor

Summary

Reviewed the 7 AI findings from GitHub Code Quality and fixed the 3 that are genuinely valid:

  • install.sh:73 — Replace head -c 200 with cut -c1-200 for POSIX compliance (BSD/macOS head doesn't support -c)
  • tests/commands/plugin/index.test.ts — Extract duplicated test setup (Command + registerPluginCommand + find) into a createProgramAndPlugin() helper
  • tests/helpers/binary-upgrade.test.ts:32 — Replace silent if (info === null) return with expect(info).not.toBeNull() so unsupported platforms fail explicitly instead of passing silently

Findings deemed not valid (no fix needed)

Finding File Reason
toBeTruthy() too weak plugin/index.test.ts Checking description exists is sufficient; hardcoding toContain("plugin") is brittle
Non-null ! assertion plugin/index.test.ts Over-engineering for tests; if find() returns undefined the next assertion fails clearly
Mock process.platform binary-upgrade.test.ts Object.defineProperty on process.platform is fragile in Bun; platform-skip pattern is standard and CI runs across platforms
i <= retries off-by-one test-utils.ts Intentional: 1 initial try + N retries = N+1 total attempts; the i === retries guard on line 42 confirms this design

Test plan

  • bun run validate passes (lint, typecheck, format, 314 tests, ADR check, build)

- install.sh: replace `head -c` with POSIX-compliant `cut -c1-200`
- tests/commands/plugin/index.test.ts: extract duplicated setup into helper
- tests/helpers/binary-upgrade.test.ts: assert non-null instead of silent return
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying archgate-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4d4744c
Status: ✅  Deploy successful!
Preview URL: https://6f60de21.archgate-cli.pages.dev
Branch Preview URL: https://claude-epic-easley.archgate-cli.pages.dev

View logs

@rhuanbarreto rhuanbarreto merged commit b4630d0 into main Mar 19, 2026
8 checks passed
@rhuanbarreto rhuanbarreto deleted the claude/epic-easley branch March 19, 2026 00:08
@github-actions github-actions Bot mentioned this pull request Mar 18, 2026
rhuanbarreto added a commit that referenced this pull request Mar 20, 2026
- install.sh: replace `head -c` with POSIX-compliant `cut -c1-200`
- tests/commands/plugin/index.test.ts: extract duplicated setup into helper
- tests/helpers/binary-upgrade.test.ts: assert non-null instead of silent return
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