Repository navigation
--only: run a subset of the config's routes with their hooks - #118
Merged
Merged
Conversation
Routes given on the command line replace the config's, so they lose its per-route before/beforeShot hooks and selectors. --only <route|file> filters the config's routes instead: same path or pair, or the same selector with '/a @sel'. A value naming a file in cwd lists one route per line. Each value or line that matches no config route exits 2 with the routes the config has. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Refs #113 (last item, "Run a config's hooks on a subset")
Refs #59 ("CLI routes lose their config hooks")
Change
--only <route|file>filters the config'sroutesand keeps each picked route's ownbefore/beforeShothooks and selector, plus the global hooks and masks. Routes given on the command line work as before: a plainrenderdiff /astill replaces the config's routes.@sel, the selector must match too. Matching useslabel()rather thanname(), so--only /pricingfinds a config route that has its own selector.Errors (exit 2)
--only /x matches no config route; the config has: /a, /b [.card], …(up to 20 listed). A file line is named:--only routes.txt: "/x" (line 3) matches no config route; ….(and no such file).the config has no routes.--onlywith routes on the command line, or with--sitemap, is a usage error. So is--onlywith no config file, an--onlyfile with no routes, orrenderdiff probe … --only.--rerun-failed
No change. A rerun has to repeat the last run's routes, so rerun with the same
--only. A different or missing--onlygets the existing "routes … differ" error. The README says so.Docs
--help, the README usage table, the exit-code row and the rerun paragraph.renderdiff.config.example.ts.Verification
npm run typecheck,npm run lint,npm run format:check: cleannpm test: 371 pass. New--dry-runtests cover:beforehook);' @sel'narrows to one;cli-args: an empty value,--onlywith CLI routes or--sitemap, andprobe --only.run().🤖 Generated with Claude Code