Skip to content

Document installing the pre-commit Git hook #3014

Description

@loganrosen

Problem

The README's “Auto-formatting with pre-commit” section tells contributors to install the pre-commit executable with:

uv tool install pre-commit

It then says every commit will be checked, but it never installs the repository's Git hook. Without that hook, commits are not checked locally and formatting failures are only caught after CI runs.

This occurred on #3004: manual pre-commit run --all-files validation happened while newly added files were still untracked, so they were skipped; the commit itself did not run a hook and CI later caught the Ruff formatting changes.

Suggested change

Add the hook installation step after installing the executable:

pre-commit install

It may also be worth clarifying that pre-commit run --all-files only covers Git-tracked files, while the commit hook checks staged files, including newly added files.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions