Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1353 +/- ##
==========================================
+ Coverage 90.33% 90.38% +0.04%
==========================================
Files 82 82
Lines 16147 16210 +63
==========================================
+ Hits 14587 14652 +65
+ Misses 1560 1558 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📦 Cargo Bloat ComparisonBinary size change: +0.00% (22.4 MiB → 22.4 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
fbfa5ad to
2ee4d52
Compare
There was a problem hiding this comment.
Pull request overview
This PR implements a user-facing warning when acquiring a file lock takes longer than 1 second, addressing issue #1184. The warning helps users understand why the command might appear to be hanging when another prek process is holding the lock.
Changes:
- Implemented a timeout-based warning mechanism in the lock acquisition logic using
tokio::select! - Introduced a global reporter infrastructure to allow lock warnings to properly suspend progress bars
- Converted reporter constructors from
Fromtrait implementations to explicitnew()methods that set the global reporter
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/prek/src/fs.rs | Added timeout logic with warning message when lock acquisition blocks for more than 1 second |
| crates/prek/src/cli/reporter.rs | Added global reporter state and suspend mechanism to allow warnings to be displayed without corrupting progress bars |
| crates/prek/src/cli/run/run.rs | Updated to use new reporter constructor pattern |
| crates/prek/src/cli/list.rs | Updated to use new reporter constructor pattern |
| crates/prek/src/cli/install.rs | Updated to use new reporter constructor pattern |
| crates/prek/src/cli/auto_update.rs | Updated to use new reporter constructor pattern |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Closes #1184