Summary
The local make tc hook in prek.toml is currently configured like a normal file-scoped hook, even though make tc is meant to run repository-wide validation exactly once per invocation.
Problem
prek can skip the hook when the selected file set is empty, so repository-level checks do not run in some file-driven invocations.
- When the hook does run,
prek passes matched filenames to make tc, which makes make treat those paths as extra targets.
- In verbose output that shows up as lines such as
make: Nothing to be done for 'prek.toml'., which means the hook behavior is coupled to the current file list instead of just running the validation chain.
Reproduction
- Keep the local hook in
prek.toml without always_run = true and pass_filenames = false.
- Run
uv run prek run make-tc --files does-not-exist.txt --config prek.toml.
- Observe that
make tc is skipped with (no files to check).
- Run
uv run prek run -v make-tc --files prek.toml --config prek.toml.
- Observe that
make receives the filename as an extra target and reports Nothing to be done for 'prek.toml'.
Expected
make tc should run as a repository-level validation hook every time it is selected, and it should not receive filenames from prek.
Summary
The local
make tchook inprek.tomlis currently configured like a normal file-scoped hook, even thoughmake tcis meant to run repository-wide validation exactly once per invocation.Problem
prekcan skip the hook when the selected file set is empty, so repository-level checks do not run in some file-driven invocations.prekpasses matched filenames tomake tc, which makesmaketreat those paths as extra targets.make: Nothing to be done for 'prek.toml'., which means the hook behavior is coupled to the current file list instead of just running the validation chain.Reproduction
prek.tomlwithoutalways_run = trueandpass_filenames = false.uv run prek run make-tc --files does-not-exist.txt --config prek.toml.make tcis skipped with(no files to check).uv run prek run -v make-tc --files prek.toml --config prek.toml.makereceives the filename as an extra target and reportsNothing to be done for 'prek.toml'.Expected
make tcshould run as a repository-level validation hook every time it is selected, and it should not receive filenames fromprek.