Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1706 +/- ##
==========================================
+ Coverage 91.59% 91.63% +0.04%
==========================================
Files 98 98
Lines 19324 19459 +135
==========================================
+ Hits 17699 17831 +132
- Misses 1625 1628 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📦 Cargo Bloat ComparisonBinary size change: +0.40% (24.7 MiB → 24.8 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for running “legacy mode” Git hook scripts alongside (or in place of) prek’s hook implementation, enabling hook migration via <hook_type>.legacy scripts in the hooks directory.
Changes:
- Execute an executable
{hook_type}.legacyhook (with recursion guard) and merge its exit status with prek’s. - Capture
pre-pushstdin once and reuse it for both legacy hook execution and push-info parsing. - Add Unix-only integration tests covering legacy hook execution for
pre-commitandpre-push.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
crates/prek/src/cli/hook_impl.rs |
Runs legacy hooks, captures stdin for pre-push, and combines legacy+prek exit statuses. |
crates/prek/src/cli/mod.rs |
Adds From<u8> for ExitStatus to convert legacy exit codes. |
crates/prek-consts/src/env_vars.rs |
Introduces PREK_RUNNING_LEGACY env var constant for recursion prevention. |
crates/prek/tests/hook_impl.rs |
Adds Unix-only tests validating legacy hook behavior. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1700