Detect install source for actionable upgrade hints#1540
Merged
j178 merged 2 commits intoj178:masterfrom Feb 3, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1540 +/- ##
==========================================
- Coverage 91.65% 91.57% -0.09%
==========================================
Files 90 91 +1
Lines 17813 17892 +79
==========================================
+ Hits 16326 16384 +58
- Misses 1487 1508 +21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📦 Cargo Bloat ComparisonBinary size change: +0.00% (23.2 MiB → 23.2 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
670c059 to
6ddfb43
Compare
Detects how prek was installed (Homebrew or Cargo) by inspecting the executable path, then provides actionable upgrade hints when: - `prek self update` fails (not installed via standalone scripts) - `minimum_prek_version` isn't satisfied Detection heuristics: - Homebrew: path contains `/Cellar/prek/` - Cargo: path contains `/.cargo/bin/` Based on astral-sh/uv#16838.
6ddfb43 to
e1c0f2a
Compare
j178
added a commit
that referenced
this pull request
Feb 3, 2026
Just realized that [`cargo-binstall`](https://github.com/cargo-bins/cargo-binstall) also installs things into `~/.cargo/bin`, so there’s no (easy) way to tell whether something was installed with `cargo install` or `cargo binstall`. Partially reverts #1540
j178
added a commit
that referenced
this pull request
Feb 3, 2026
Just realized that [`cargo-binstall`](https://github.com/cargo-bins/cargo-binstall) also installs things into `~/.cargo/bin`, so there’s no (easy) way to tell whether something was installed with `cargo install` or `cargo binstall`. Partially reverts #1540
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.
Detects how prek was installed (Homebrew or Cargo) by inspecting the executable path, then provides actionable upgrade hints when:
prek self updatefails because prek wasn't installed via standalone scriptsminimum_prek_versionisn't satisfiedBased largely on the approach uv implemented in astral-sh/uv#16838.
Detection heuristics:
/Cellar/prek//.cargo/bin/Example output:
See discussion in #1490 for further context.