Skip to content

Add a repo: self option to allow easy consumption of hooks defined inside .pre-commit-hooks.yaml #1598

@ssbarnea

Description

@ssbarnea

By adding an option like repo: self or repo: ., that would not use rev, we could simplify self-testing of hook defined in current repository. This would help testing for hook publishers.

Current we are using other more convoluted methods for tests hooks defined locally while we are unable to use our own hooks inside the same repository that exposes them.

An alternative to this would be extend the meaning of the current repo: local to allow referencing hooks defined inside pre-commit-hooks.yaml without having to redefine them there (basically being able to mention just their id).

I hope this describes well enough the use case. I currently maintain a collection of hook at https://github.com/ansible/actions/blob/main/.pre-commit-hooks.yaml which rely on uv an npm native version management for reasons explained in #1462

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