Skip to content

Pass paths to deleted files to hooks #1489

@adzenith

Description

@adzenith

I would love some sort of option like:

pass_deleted_files: true

that would then pass the paths to deleted files to the hooks in question.

As an example, I have a script that collates information from files in the repo and updates a central list. If you add or modify a file this works perfectly in prek, but if you delete a file the hook doesn't get run and the central list is out of date.

We used to use pre-commit, and the recommendation there was essentially to reimplement in each such check the code for figuring out which files have been changed. But it would be really nice if this were built in and checks could get a battle-tested version for free.

Thank you!

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