You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, kudos for reimplementing pre-commit in Rust! As usual, it is much faster than the original python implementation, and I like the extended funcionality (globs, env, etc.).
However, it seems like legacy mode (called "migration mode" in pre-commit) is not 100% supported:
When installing either pre-commit or prek, they rename pre-existing hook files to <hook_name>.legacy.
On uninstall, the legacy hook is also restored by both.
When hook-impl is called, and the legacy hook is present, pre-commit executes it before the hooks in .pre-commit-config.yaml, while prek quietly ignores it.
Here's the location where this should be implemented, but there's only a TODO comment:
In the project I'm working on, we were using a custom script to run pre-commit hooks. Recently, we have migrated to pre-commit, but we still have a couple harder-to-migrate hooks in the old system; having pre-commit run the old script from pre-commit.legacy made it possible to start using pre-commit in parallel to our older hooks. We're considering moving to prek, but not being able to run the legacy hooks is a deal-breaker until we're able to migrate all our hooks to the new system, which may take a while.
Request
I think prek missing this feature should be called out in the Differences section of the documentation.
In addition, it would be great if you could add support for legacy hooks. I'm also interested in any ideas for a workaround with the current feature set that would allow us to migrate from pre-commit to prek while still running our legacy hooks.
Activity
Support legacy mode hook script (j178#1706)