Remove direct path support from language_version#1831
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes (non-working) support for specifying direct executable paths in language_version requests, simplifying request parsing and version matching across supported language installers.
Changes:
- Dropped path-based parsing/variants from Bun/Go/Node/Python/Ruby
language_versionrequest types and updated matching APIs accordingly. - Simplified installer matching by removing the unused “toolchain path” parameter from
matches(...). - Updated docs to stop advertising absolute-path
language_versionvalues.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/languages.md | Removes documentation implying language_version can be an absolute executable path. |
| docs/configuration.md | Updates language_version docs to avoid advertising interpreter-name/path behavior that no longer applies. |
| crates/prek/src/languages/rust/version.rs | Simplifies RustRequest::matches signature and updates call sites/tests. |
| crates/prek/src/languages/rust/installer.rs | Updates matching calls to new matches(...) signature. |
| crates/prek/src/languages/ruby/version.rs | Removes path request variant and updates parsing/matching/tests. |
| crates/prek/src/languages/ruby/installer.rs | Updates matching calls to new matches(...) signature. |
| crates/prek/src/languages/python/version.rs | Removes path request variant and updates parsing/matching/tests. |
| crates/prek/src/languages/python/python.rs | Removes UV request conversion support for removed Path request variant. |
| crates/prek/src/languages/node/version.rs | Removes path request variant and updates parsing/matching/tests. |
| crates/prek/src/languages/node/installer.rs | Updates matching calls to new matches(...) signature. |
| crates/prek/src/languages/golang/version.rs | Removes path request variant and updates parsing/matching/tests. |
| crates/prek/src/languages/golang/installer.rs | Updates matching calls to new matches(...) signature. |
| crates/prek/src/languages/bun/version.rs | Removes path request variant and updates parsing/matching/tests. |
| crates/prek/src/languages/bun/installer.rs | Updates matching calls to new matches(...) signature. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1831 +/- ##
==========================================
+ Coverage 91.79% 91.82% +0.02%
==========================================
Files 98 98
Lines 20119 20059 -60
==========================================
- Hits 18469 18419 -50
+ Misses 1650 1640 -10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📦 Cargo Bloat ComparisonBinary size change: +0.00% (24.8 MiB → 24.8 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
⚡️ Hyperfine BenchmarksSummary: 0 regressions, 0 improvements above the 10% threshold. Environment
CLI CommandsBenchmarking basic commands in the main repo:
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base --version |
1.8 ± 0.1 | 1.6 | 2.3 | 1.00 |
prek-head --version |
1.8 ± 0.1 | 1.6 | 2.3 | 1.01 ± 0.09 |
prek list
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base list |
7.4 ± 0.1 | 7.1 | 7.8 | 1.00 ± 0.02 |
prek-head list |
7.4 ± 0.1 | 7.1 | 7.8 | 1.00 |
prek validate-config .pre-commit-config.yaml
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base validate-config .pre-commit-config.yaml |
2.5 ± 0.1 | 2.4 | 2.8 | 1.00 |
prek-head validate-config .pre-commit-config.yaml |
2.5 ± 0.1 | 2.4 | 2.6 | 1.01 ± 0.04 |
prek sample-config
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base sample-config |
2.0 ± 0.0 | 1.9 | 2.1 | 1.00 |
prek-head sample-config |
2.0 ± 0.0 | 1.9 | 2.1 | 1.00 ± 0.03 |
Cold vs Warm Runs
Comparing first run (cold) vs subsequent runs (warm cache):
prek run --all-files (cold - no cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --all-files |
98.7 ± 0.9 | 97.1 | 100.1 | 1.00 |
prek-head run --all-files |
99.5 ± 1.7 | 97.7 | 102.5 | 1.01 ± 0.02 |
prek run --all-files (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --all-files |
99.5 ± 1.8 | 96.7 | 102.6 | 1.00 ± 0.02 |
prek-head run --all-files |
99.2 ± 1.2 | 97.3 | 101.1 | 1.00 |
Full Hook Suite
Running the builtin hook suite on the benchmark workspace:
prek run --all-files (full builtin hook suite)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --all-files |
100.2 ± 2.6 | 96.1 | 110.1 | 1.00 |
prek-head run --all-files |
100.3 ± 2.6 | 96.2 | 112.6 | 1.00 ± 0.04 |
Individual Hook Performance
Benchmarking each hook individually on the test repo:
prek run trailing-whitespace --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run trailing-whitespace --all-files |
14.4 ± 0.2 | 14.1 | 14.8 | 1.00 |
prek-head run trailing-whitespace --all-files |
14.5 ± 0.3 | 14.0 | 15.3 | 1.01 ± 0.02 |
prek run end-of-file-fixer --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run end-of-file-fixer --all-files |
19.4 ± 0.8 | 17.8 | 21.9 | 1.00 ± 0.07 |
prek-head run end-of-file-fixer --all-files |
19.3 ± 1.1 | 17.3 | 21.8 | 1.00 |
prek run check-json --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-json --all-files |
8.9 ± 0.2 | 8.6 | 9.2 | 1.03 ± 0.04 |
prek-head run check-json --all-files |
8.7 ± 0.2 | 8.3 | 9.3 | 1.00 |
prek run check-yaml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-yaml --all-files |
8.5 ± 0.1 | 8.2 | 8.8 | 1.00 |
prek-head run check-yaml --all-files |
8.8 ± 0.3 | 8.4 | 9.4 | 1.04 ± 0.04 |
prek run check-toml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-toml --all-files |
8.6 ± 0.2 | 8.3 | 9.3 | 1.01 ± 0.03 |
prek-head run check-toml --all-files |
8.5 ± 0.2 | 8.1 | 9.0 | 1.00 |
prek run check-xml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-xml --all-files |
8.5 ± 0.2 | 8.1 | 9.1 | 1.01 ± 0.04 |
prek-head run check-xml --all-files |
8.5 ± 0.3 | 8.1 | 9.2 | 1.00 |
prek run detect-private-key --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run detect-private-key --all-files |
13.9 ± 2.0 | 12.0 | 20.0 | 1.05 ± 0.16 |
prek-head run detect-private-key --all-files |
13.2 ± 0.7 | 12.2 | 15.1 | 1.00 |
prek run fix-byte-order-marker --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run fix-byte-order-marker --all-files |
25.6 ± 22.7 | 15.1 | 105.4 | 1.53 ± 1.36 |
prek-head run fix-byte-order-marker --all-files |
16.7 ± 0.8 | 15.3 | 17.9 | 1.00 |
Installation Performance
Benchmarking hook installation (fast path hooks skip Python setup):
prek install-hooks (cold - no cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base install-hooks |
3.8 ± 0.1 | 3.6 | 4.0 | 1.00 ± 0.04 |
prek-head install-hooks |
3.8 ± 0.0 | 3.7 | 3.8 | 1.00 |
prek install-hooks (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base install-hooks |
3.7 ± 0.0 | 3.7 | 3.8 | 1.00 |
prek-head install-hooks |
3.8 ± 0.1 | 3.7 | 3.9 | 1.01 ± 0.03 |
File Filtering/Scoping Performance
Testing different file selection modes:
prek run (staged files only)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run |
35.8 ± 0.7 | 34.8 | 37.1 | 1.00 |
prek-head run |
35.9 ± 0.8 | 34.7 | 37.7 | 1.00 ± 0.03 |
prek run --files '*.json' (specific file type)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --files '*.json' |
6.3 ± 0.1 | 6.2 | 6.4 | 1.00 |
prek-head run --files '*.json' |
6.5 ± 0.3 | 6.2 | 7.3 | 1.02 ± 0.04 |
Workspace Discovery & Initialization
Benchmarking hook discovery and initialization overhead:
prek run --dry-run --all-files (measures init overhead)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --dry-run --all-files |
9.6 ± 0.2 | 9.3 | 10.0 | 1.00 |
prek-head run --dry-run --all-files |
9.8 ± 0.3 | 9.4 | 10.9 | 1.03 ± 0.04 |
Meta Hooks Performance
Benchmarking meta hooks separately:
prek run check-hooks-apply --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-hooks-apply --all-files |
9.8 ± 0.2 | 9.5 | 10.4 | 1.04 ± 0.05 |
prek-head run check-hooks-apply --all-files |
9.4 ± 0.4 | 8.9 | 10.0 | 1.00 |
prek run check-useless-excludes --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-useless-excludes --all-files |
9.1 ± 0.1 | 9.0 | 9.4 | 1.01 ± 0.02 |
prek-head run check-useless-excludes --all-files |
9.0 ± 0.1 | 8.8 | 9.2 | 1.00 |
prek run identity --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run identity --all-files |
7.9 ± 0.5 | 7.5 | 9.3 | 1.01 ± 0.06 |
prek-head run identity --all-files |
7.8 ± 0.1 | 7.6 | 8.0 | 1.00 |
Summary
Closes #1581
Remove direct path handling from
language_versionrequest parsing across languagesNotes
This path support never actually worked, so this likely should not be considered a breaking change.