Skip to content

prek uninstall removes legacy scripts too#1622

Merged
j178 merged 1 commit intomasterfrom
legacy
Feb 10, 2026
Merged

prek uninstall removes legacy scripts too#1622
j178 merged 1 commit intomasterfrom
legacy

Conversation

@j178
Copy link
Owner

@j178 j178 commented Feb 10, 2026

Closes #1621

Copilot AI review requested due to automatic review settings February 10, 2026 10:52
@j178 j178 added the enhancement New feature or request label Feb 10, 2026
@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

❌ Patch coverage is 85.71429% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.73%. Comparing base (031e53b) to head (7ea69b6).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
crates/prek/src/cli/install.rs 85.71% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1622      +/-   ##
==========================================
- Coverage   91.73%   91.73%   -0.01%     
==========================================
  Files          96       96              
  Lines       18630    18642      +12     
==========================================
+ Hits        17091    17102      +11     
- Misses       1539     1540       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates prek uninstall behavior to clean up leftover *.legacy hook scripts that were created/managed by prek, preventing stale legacy hook files from lingering in .git/hooks.

Changes:

  • Extend uninstall logic to detect and remove legacy hook files (<hook>.legacy) when they match prek’s managed script signature.
  • Adjust user-facing uninstall output when restoring a legacy hook back into place.
  • Add an integration test covering removal of prek-managed legacy hooks while preserving/restoring non-prek legacy scripts.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
crates/prek/src/cli/install.rs Updates uninstall flow to remove prek-managed legacy hooks and refines restore messaging.
crates/prek/tests/install.rs Updates uninstall snapshots and adds coverage for legacy-hook cleanup behavior.

@j178 j178 merged commit 92647ff into master Feb 10, 2026
55 checks passed
@j178 j178 deleted the legacy branch February 10, 2026 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

prek shouldn't trigger on pre-commit.legacy hooks

2 participants