Skip to content

make tc hook should run as a repository-level prek hook #82

@WH-2099

Description

@WH-2099

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

  1. Keep the local hook in prek.toml without always_run = true and pass_filenames = false.
  2. Run uv run prek run make-tc --files does-not-exist.txt --config prek.toml.
  3. Observe that make tc is skipped with (no files to check).
  4. Run uv run prek run -v make-tc --files prek.toml --config prek.toml.
  5. 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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions