#2730·prek

Project-wide checks can be skipped for deletion-only changes

Author: j178Created Sep 18, 2026Updated Sep 18, 2026
Labelsneeds design

Our current execution model is centered on selecting file inputs for hooks:

  1. Collect candidate files from the selected scope, such as staged changes or a commit range.
  2. Apply files / exclude and type filters (types, types_or, exclude_types) to determine the hook’s input.
  3. Skip the hook when that input is empty, unless always_run: true.

pass_filenames: false only controls whether filenames are passed to the command. It does not remove the requirement for matching input.

Deleted paths fall outside this model. They no longer have a file entity in the working tree to inspect or process, and type identification can depend on metadata, shebangs, or content. We therefore exclude deletions before matching hooks. Adjusting files or exclude cannot make those paths trigger a check.

This leaves a gap for project-wide checks such as Clippy, type checking, and test suites. Deleting a Rust module can break compilation without leaving any matching file input, so the check is skipped precisely when it could catch a regression.

The underlying limitation is that we use the same file selection to determine both what a hook processes and whether it needs to run. A deletion provides no current file to process, but it can invalidate the project’s correctness. always_run: true avoids missed checks at the cost of also running them for unrelated changes.

Related issues:

  • #1489: hooks that need to react to deleted files
  • #1897: project-wide checks beyond the changed-file list
  • #2144: hooks skipped when no candidate files are available
  • #1055: checks triggered by changes in another project
  • rolter-ai/rolter#1526: deletion-only Rust changes skip local Clippy checks in both staged and commit-range runs