Skip to content

feat: exit 0 on --filter no-match, add --fail-if-no-match#393

Open
kazupon wants to merge 1 commit into
voidzero-dev:mainfrom
kazupon:feat/fail-if-no-match
Open

feat: exit 0 on --filter no-match, add --fail-if-no-match#393
kazupon wants to merge 1 commit into
voidzero-dev:mainfrom
kazupon:feat/fail-if-no-match

Conversation

@kazupon
Copy link
Copy Markdown
Contributor

@kazupon kazupon commented May 20, 2026

Summary

  • Match pnpm: vp run --filter <expr> now exits 0 with a warning when the expression matches no packages, instead of failing with Task "X" not found.
  • This also covers --filter {.}^... on a leaf package: the seed matches but the traversal collapses to zero, a legitimate no-op rather than a typo.
  • Add --fail-if-no-match for callers (CI scripts) that want the previous strict behaviour. In strict mode, any unmatched --filter aborts the run, even when other filters did match.

Implementation notes

  • unmatched_selectors now tracks filters whose expanded set is empty (was: whose core selector matched nothing), so traversal collapses are reported too.
  • TaskQueryResult exposes selected_package_count and plan_query returns a PlanResult { graph, no_packages_matched } so the CLI can distinguish "no packages matched filter" (succeed) from "packages matched but task missing" (still errors as NoTasksMatched).
  • Nested vp run --filter X build inside a task script gets the same default-success treatment.

Closes #380

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.

--filter no-match should not fail by default; add --fail-if-no-match for strict mode

1 participant