Skip to content

Proposal optimization: don't download hooks that are not triggered #1459

@awoimbee

Description

@awoimbee

What

In a repo like:

.
├── .pre-commit-config.yaml
├── proj-a/
│   └── ...
└── proj-b/
    ├── .pre-commit-config.yaml
    └── ...

If I only update a file proj-a/.
Don't download the hooks of proj-b on commit (and on prek run ?).

Why

For speed and so one project's pre-commit config doesn't impact development on another project.

Bonus: generalize

Don't download hooks if no file matches in the steps (due to files/exclude regexes).
I can see how that's harder to implement !


Is that feasible ? Hard to implement because of the current architecture ?
Is that something that would be welcome to the project ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    ideaJust an idea

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions