Skip to content

chore: add ShellCheck lint script (#6)#9

Merged
montoyaedu merged 1 commit into
masterfrom
chore/issue-6-shellcheck-lint
May 17, 2026
Merged

chore: add ShellCheck lint script (#6)#9
montoyaedu merged 1 commit into
masterfrom
chore/issue-6-shellcheck-lint

Conversation

@montoyaedu
Copy link
Copy Markdown
Member

What

Introduces npm run lint (ShellCheck) — blocker 1 of 2 for unblocking git push. The .husky/pre-push hook's Lint stage ran npm run lint, which didn't exist; now it does and exits 0.

Closes #6.

Changes

New lint script (package.json) — runs shellcheck over the project's own shell sources: easy, configure-local-devenv, commands/*.sh, the easyhome/ shell scripts, and .husky/pre-push.

Real errors fixed:

  • easy$@ passed unquoted at 4 dispatcher call sites (ruby, python, __easy_command_*, top-level easy). SC2068 — unquoted $@ re-splits arguments. Now "$@".
  • commands/proxy.shdebug() was $(>&2 echo $@): the $() captures stdout (redirected away → empty) and then tries to execute that empty string. Replaced with >&2 echo "$@". Fixes SC2328/SC2068/SC2091/SC2327/SC2116.

Pre-existing warnings baselined — per the agreed scoped approach, the remaining ~55 findings (mostly SC2086 unquoted vars, SC2155 declare+assign) are suppressed with documented file-level # shellcheck disable= directives, each pointing to the cleanup issue. Burn-down tracked in #8.

DocsCLAUDE.md §3 documents the shellcheck prerequisite and npm run lint.

Scope deviation from the issue

Issue #6 listed bin/*.sh as lint targets. Those are metaswarm-vendored third-party scripts (overwritten on plugin update) — adding disable directives to them would be inappropriate, so they're excluded from the lint set. .husky/pre-push is included (currently clean).

Test plan

Notes

🤖 Generated with Claude Code

Introduce `npm run lint` (shellcheck) to unblock the pre-push hook's
lint stage.

- Add `lint` npm script covering easy, commands/*.sh, easyhome/* shell
  scripts, and .husky/pre-push
- Fix real errors:
  - easy: quote $@ in 4 dispatcher call sites (SC2068 — arg resplitting)
  - commands/proxy.sh: fix broken debug() — $(>&2 echo $@) executes
    captured-empty output; replaced with >&2 echo "$@" (SC2328/SC2068)
- Baseline remaining pre-existing warnings with documented file-level
  `# shellcheck disable=` directives (cleanup tracked in #8)
- Document shellcheck prerequisite + `npm run lint` in CLAUDE.md

Closes #6

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@montoyaedu
Copy link
Copy Markdown
Member Author

Smoke test — dispatcher

Ran with EASY_LETSENCRYPT_DIR/EASY_DOMAINS_DIR set, repo on PATH:

Command Result
easy --version 2.0.0, exit 0
easy (no args) usage shown
easy bogus-cmd usage shown
easy proxy routes to commands/proxy.sh → proxy usage

The "$@" quoting fix in the dispatcher routes arguments correctly. bash -n passed on all 6 edited shell files.

Note: CI does not run on this PR — .github/workflows/ci.yml (metaswarm-scaffolded) triggers on branch main, but this repo's default branch is master. Tracked separately from #6.

@montoyaedu montoyaedu merged commit d5e5368 into master May 17, 2026
montoyaedu added a commit that referenced this pull request May 18, 2026
STATE.md was dated 2026-04-02 and predated the entire test-harness /
ShellCheck / issue-5 / release-prep / self-contained-build work — it
still listed obsolete blockers (push the base image to Docker Hub).

Rewrite it: current version state, the PRs #9#17 shipped this phase,
the remaining items (npm publish, clean-room test, real IONOS test).

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.

Add ShellCheck lint script (unblocks pre-push hook — lint stage)

1 participant