This recipe uses --changed-only to scan just the files a pull request touches, so PR pipelines stay fast. It is for teams whose full-repository scans are too slow to run on every commit.
When to use changed-only scans
A full scan measures the whole codebase. On large repositories that can be slow for every PR. Scanning only changed files gives quick feedback on what the author actually modified, while a scheduled full scan keeps the overall trend honest.
The command
npx @vibgrate/cli scan --changed-only
Post-install:
vg scan --changed-only
This restricts the scan to files changed relative to the comparison point, rather than the entire project.
Combining with a gate
Pair changed-only with a quality gate so fast PR feedback can still block regressions:
vg scan --changed-only --fail-on error
Pair with a full scheduled scan
Changed-only scans can miss drift in files the PR did not touch. Run a full scan on a schedule to catch repo-wide drift. See Schedule nightly Vibgrate scans in CI.
Caching
Changed-only scans still benefit from the Vibgrate cache for unchanged context. See Cache Vibgrate scans in CI.
Related
- Monorepo matrix scans for splitting large repos by package.
- Gate pull requests on a drift budget for numeric gating.