Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v04 #1966 +/- ##
======================================
Coverage ? 92.08%
======================================
Files ? 116
Lines ? 23170
Branches ? 0
======================================
Hits ? 21335
Misses ? 1835
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Reverts the behavior where prek install propagated global flags (e.g., -q/-v/--no-progress) into the generated Git hook scripts, aligning CLI semantics with user expectations and issue #1965. The PR also removes support for using absolute executable paths as language_version requests for several languages.
Changes:
- Stop embedding global CLI flags into generated hook scripts (and simplify install/init-template-dir wiring).
- Remove absolute-path
language_versionrequest support for Bun/Go/Node/Python/Ruby (docs + parsing/matching updates, tests adjusted). - Update integration tests/snapshots and language version matching APIs accordingly.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| docs/languages.md | Removes documentation implying absolute-path language_version support. |
| docs/configuration.md | Updates Python language_version description to omit interpreter-path wording. |
| crates/prek/tests/languages/ruby.rs | Drops the path-based Ruby language_version scenario from integration tests/snapshots. |
| crates/prek/tests/install.rs | Removes install-flag propagation tests (quiet/verbose/no-progress). |
| crates/prek/src/main.rs | Stops passing global quiet/verbose/no-progress into install/init-template-dir. |
| crates/prek/src/cli/install.rs | Removes global-flag passthrough into hook script template and deletes related helper. |
| crates/prek/src/languages/rust/{version.rs,installer.rs} | Simplifies matching API (removes unused toolchain param) and updates call sites/tests. |
| crates/prek/src/languages/ruby/{version.rs,installer.rs} | Removes path request support; updates matching and installer logic/tests. |
| crates/prek/src/languages/python/{version.rs,python.rs} | Removes path request support and updates uv request rendering + tests. |
| crates/prek/src/languages/node/{version.rs,installer.rs} | Removes path request support and updates matching/installer logic + tests. |
| crates/prek/src/languages/golang/{version.rs,installer.rs} | Removes path request support and updates matching/installer logic + tests. |
| crates/prek/src/languages/bun/{version.rs,installer.rs} | Removes path request support and updates matching/installer logic + tests. |
| #[test] | ||
| fn install_with_git_dir() { | ||
| let context = TestContext::new(); |
There was a problem hiding this comment.
The removed install_with_quiet_flag / install_with_silent_flag / install_with_verbose_flag / install_with_no_progress_flag tests previously ensured global flags were not baked into the generated hook script. Since the default install snapshot won’t catch regressions that only happen when prek install is invoked with -q/-v/--no-progress, consider reintroducing at least one targeted test that runs install -q (or similar) and asserts the installed script does not contain those flags.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cc0ea651d8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| fi | ||
|
|
||
| exec "$PREK" [PREK_GLOBAL_ARGS]hook-impl --hook-dir "$HERE" --script-version [CUR_SCRIPT_VERSION] [PREK_ARGS] -- "$@" | ||
| exec "$PREK" hook-impl --hook-dir "$HERE" --script-version [CUR_SCRIPT_VERSION] [PREK_ARGS] -- "$@" |
There was a problem hiding this comment.
Bump hook script version after changing shim template
The generated hook command was changed here to remove inherited global flags, but CUR_SCRIPT_VERSION remains 4, and hook_impl only warns about outdated shims when the script version changes. That means repos that already have hooks installed from the previous template (also stamped as version 4, with -q/-v/--no-progress embedded) will keep the old behavior with no reinstall warning, so this revert does not actually take effect for existing installs unless users manually rerun prek install.
Useful? React with 👍 / 👎.
📦 Cargo Bloat ComparisonBinary size change: +0.00% (25.8 MiB → 25.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 |
2.2 ± 0.1 | 2.1 | 2.9 | 1.02 ± 0.06 |
prek-head --version |
2.2 ± 0.1 | 2.1 | 2.6 | 1.00 |
prek list
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base list |
9.0 ± 0.3 | 8.6 | 11.0 | 1.02 ± 0.04 |
prek-head list |
8.9 ± 0.2 | 8.6 | 10.0 | 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 |
3.1 ± 0.1 | 2.9 | 3.2 | 1.01 ± 0.02 |
prek-head validate-config .pre-commit-config.yaml |
3.0 ± 0.0 | 3.0 | 3.2 | 1.00 |
prek sample-config
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base sample-config |
2.5 ± 0.0 | 2.4 | 2.6 | 1.00 |
prek-head sample-config |
2.5 ± 0.0 | 2.4 | 2.6 | 1.00 ± 0.02 |
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 |
142.0 ± 3.4 | 136.9 | 147.9 | 1.02 ± 0.03 |
prek-head run --all-files |
139.2 ± 2.8 | 133.9 | 142.5 | 1.00 |
prek run --all-files (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --all-files |
139.4 ± 4.0 | 133.8 | 145.0 | 1.01 ± 0.03 |
prek-head run --all-files |
138.2 ± 2.6 | 134.3 | 143.0 | 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 |
137.4 ± 2.9 | 132.7 | 143.6 | 1.00 |
prek-head run --all-files |
139.2 ± 3.9 | 131.7 | 150.3 | 1.01 ± 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 |
20.2 ± 0.6 | 19.3 | 21.9 | 1.02 ± 0.04 |
prek-head run trailing-whitespace --all-files |
19.8 ± 0.4 | 19.0 | 20.6 | 1.00 |
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 |
36.6 ± 37.7 | 23.3 | 217.4 | 1.36 ± 1.41 |
prek-head run end-of-file-fixer --all-files |
26.9 ± 2.2 | 23.2 | 31.0 | 1.00 |
prek run check-json --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-json --all-files |
11.7 ± 0.3 | 10.9 | 12.5 | 1.04 ± 0.04 |
prek-head run check-json --all-files |
11.2 ± 0.3 | 10.8 | 11.8 | 1.00 |
prek run check-yaml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-yaml --all-files |
11.0 ± 0.2 | 10.7 | 11.4 | 1.00 |
prek-head run check-yaml --all-files |
11.3 ± 0.2 | 11.0 | 11.7 | 1.03 ± 0.02 |
prek run check-toml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-toml --all-files |
11.2 ± 0.4 | 10.5 | 11.9 | 1.00 |
prek-head run check-toml --all-files |
11.4 ± 0.2 | 10.9 | 11.7 | 1.02 ± 0.04 |
prek run check-xml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-xml --all-files |
11.2 ± 0.3 | 10.7 | 11.7 | 1.00 |
prek-head run check-xml --all-files |
11.2 ± 0.2 | 10.8 | 11.7 | 1.00 ± 0.03 |
prek run detect-private-key --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run detect-private-key --all-files |
17.2 ± 1.3 | 15.4 | 20.4 | 1.00 |
prek-head run detect-private-key --all-files |
17.4 ± 1.2 | 15.3 | 21.0 | 1.01 ± 0.10 |
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 |
22.1 ± 1.5 | 19.3 | 24.7 | 1.00 |
prek-head run fix-byte-order-marker --all-files |
22.4 ± 1.7 | 18.9 | 25.5 | 1.01 ± 0.10 |
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 |
4.5 ± 0.1 | 4.4 | 4.7 | 1.00 |
prek-head install-hooks |
4.7 ± 0.4 | 4.4 | 5.5 | 1.04 ± 0.10 |
prek install-hooks (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base install-hooks |
4.5 ± 0.0 | 4.4 | 4.5 | 1.00 |
prek-head install-hooks |
4.5 ± 0.1 | 4.4 | 4.6 | 1.00 ± 0.02 |
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 |
47.9 ± 0.9 | 46.2 | 50.0 | 1.00 |
prek-head run |
48.0 ± 1.3 | 46.0 | 52.6 | 1.00 ± 0.03 |
prek run --files '*.json' (specific file type)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --files '*.json' |
8.3 ± 0.1 | 8.1 | 8.5 | 1.00 |
prek-head run --files '*.json' |
8.5 ± 0.2 | 8.3 | 8.9 | 1.03 ± 0.03 |
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 |
12.8 ± 0.3 | 12.4 | 13.5 | 1.01 ± 0.03 |
prek-head run --dry-run --all-files |
12.7 ± 0.2 | 12.4 | 13.1 | 1.00 |
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 |
12.4 ± 0.6 | 11.5 | 13.2 | 1.04 ± 0.06 |
prek-head run check-hooks-apply --all-files |
11.9 ± 0.3 | 11.6 | 12.5 | 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 |
11.7 ± 0.1 | 11.4 | 11.9 | 1.01 ± 0.02 |
prek-head run check-useless-excludes --all-files |
11.5 ± 0.2 | 11.2 | 11.8 | 1.00 |
prek run identity --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run identity --all-files |
10.0 ± 0.1 | 9.9 | 10.2 | 1.00 |
prek-head run identity --all-files |
10.1 ± 0.2 | 9.9 | 10.5 | 1.01 ± 0.02 |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [prek](https://github.com/j178/prek) | minor | `0.3.13` → `0.4.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>j178/prek (prek)</summary> ### [`v0.4.0`](https://github.com/j178/prek/blob/HEAD/CHANGELOG.md#040) [Compare Source](j178/prek@v0.3.13...v0.4.0) Released on 2026-05-14. ##### Breaking changes These are narrow cleanup breaks in behavior that was either temporary or never worked correctly. Most users should not need to change anything. - Generated hook scripts no longer preserve `-q`, `-v`, or `--no-progress` passed to `prek install`. This only affects users who expected those global flags to be baked into installed hooks. ([#​1966](j178/prek#1966)) - `language_version` no longer accepts direct executable paths. Use `language_version: system` for a system toolchain, or use a supported version request instead. This path form did not work reliably before, so existing working configs should be unaffected. ([#​1831](j178/prek#1831)) ##### Enhancements - Expand tilde in `--config`, `--cd`, `--log-file` and `--git-dir` ([#​2063](j178/prek#2063)) - Prevent auto-update cooldown downgrades ([#​2055](j178/prek#2055)) - Use managed npm cache for node hooks ([#​2075](j178/prek#2075)) ##### Bug fixes - Fix npm config env overrides for node hooks ([#​2074](j178/prek#2074)) ##### Documentation - Add cookbook page for enabling Git 2.54 config-based global hooks ([#​2061](j178/prek#2061)) ##### Contributors - [@​j178](https://github.com/j178) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNzguMCIsInVwZGF0ZWRJblZlciI6IjQzLjE3OC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6bWlub3IiXX0=-->
Closes #1965
Reverts #1753.
I agree that passing global flags down into installed scripts is not a good idea, so this reverts that behavior. We can add dedicated install flags later if we want explicit inherit behavior.