Skip to content

feat: configurable external checks via -- passthrough and verifyx eject#10

Merged
robdmoore merged 1 commit into
mainfrom
feat/external-check-passthrough-eject
Jul 9, 2026
Merged

feat: configurable external checks via -- passthrough and verifyx eject#10
robdmoore merged 1 commit into
mainfrom
feat/external-check-passthrough-eject

Conversation

@robdmoore

Copy link
Copy Markdown
Member

What & why

skott (and other external tools) sometimes need their invocation tweaked, but every external check was hard-wired to a single command with no way to adjust it short of dropping the built-in entirely. This adds two escape hatches so you can configure an external tool without losing the verifyx wrapper's benefits.

Changes

1. -- passthrough to the underlying tool

Anything after -- on an external check is forwarded verbatim to the tool:

verifyx circular-deps -- src/*.ts   # → skott … src/*.ts
verifyx lint -- --quiet             # → oxlint … --quiet

Args are appended unquoted so shell globs still expand. Works for every external check, not just skott. verifyx init now scaffolds verify:circular-deps as verifyx circular-deps -- src/*.ts, so skott's required target is visible and editable in package.json.

2. verifyx eject <check>

Replaces the CLI wrapper script with the raw tool command so you can own the invocation:

verifyx eject circular-deps   # verify:circular-deps → skott --displayMode=raw --showCircularDependencies --exitCodeOnCircularDependencies=1
verifyx eject lint            # verify:lint → oxlint .   AND   verify:lint:fix → oxlint --fix .

Fixable checks (lint, format) get both the base and :fix scripts — the fix-locally/check-in-CI pairing verifyx already understands. Ejecting overwrites verify:<name> (that's the point) and leaves other scripts untouched. Native checks refuse to eject (they run in-process and have no shell command to hand over).

Implementation notes

  • RunDefaultOptions.extraArgs, Check.eject, and the appendArgs helper (external.ts)
  • scaffoldArgs on the external check spec; scaffoldArgs: 'src/*.ts' on circular-deps
  • setScripts (overwriting) in packageScripts.ts; new eject command + applyEject/ejectScripts programmatic API
  • README updated (passthrough note, verifyx eject section, API exports)

Design decision worth a look

src/*.ts lives only in the scaffolded script, matching the request literally: verifyx eject circular-deps yields bare skott … (no target), and verifyx all's built-in circular-deps also runs skott target-less (unchanged). If we'd rather bake the target in everywhere, it's a one-line change.

Testing

  • New src/scaffold/eject.test.ts; extended external.test.ts and registry.test.ts
  • Manually verified passthrough (globs expand, failure hint shows the full command) and eject (writes correct scripts, overwrites wrapper, rejects native)
  • npm run verify green

🤖 Generated with Claude Code

Give external checks (skott, oxlint, etc.) two escape hatches for when
their default invocation needs tweaking:

- Passthrough: `verifyx circular-deps -- src/*.ts` forwards everything
  after `--` verbatim to the underlying tool (globs left unquoted so the
  shell still expands them). `verifyx init` scaffolds circular-deps as
  `verifyx circular-deps -- src/*.ts` so skott's required target is
  visible and editable in package.json.
- `verifyx eject <check>`: replaces the CLI wrapper script with the raw
  tool command so a consumer can own it -- e.g. verify:lint -> `oxlint .`
  and verify:lint:fix -> `oxlint --fix .`, verify:circular-deps -> the
  raw skott command. Fixable checks get both the base and :fix scripts
  (the fix-locally/check-in-CI pairing verifyx already understands).
  Native checks refuse to eject (no shell command to hand over).

Adds RunDefaultOptions.extraArgs, Check.eject, the appendArgs helper,
scaffoldArgs on the external spec, setScripts, and the eject command +
applyEject/ejectScripts programmatic API, with tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@robdmoore robdmoore marked this pull request as ready for review July 9, 2026 08:13
@robdmoore robdmoore merged commit 2bdbd1c into main Jul 9, 2026
1 check passed
@robdmoore robdmoore deleted the feat/external-check-passthrough-eject branch July 9, 2026 08:16
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