Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1776 +/- ##
==========================================
- Coverage 91.67% 91.66% -0.01%
==========================================
Files 98 98
Lines 19878 19878
==========================================
- Hits 18223 18222 -1
- Misses 1655 1656 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates user-facing terminology to reduce ambiguity between Git’s .git/hooks/* scripts and the hooks defined/configured in prek configs by renaming “Git hooks” to “Git shims” across docs and CLI help/output.
Changes:
- Update multiple docs pages (quickstart/FAQ/configuration/authoring) to refer to
.git/hooks/*scripts as “Git shims”. - Update CLI help strings and a CI hint message to use “Git shims”.
- Update a config struct doc comment to align with the new terminology.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/quickstart.md | Rewords migration + setup guidance to say “Git shims”. |
| docs/faq.md | Clarifies the “two kinds of hooks” explanation using “Git shims”. |
| docs/configuration.md | Rewords default_install_hook_types description around “Git shims”. |
| docs/authoring-hooks.md | Updates stages section wording (now says “Git stages”). |
| crates/prek/src/config.rs | Updates HookOptions.stages doc comment wording. |
| crates/prek/src/cli/run/run.rs | Updates CI hint message to say “Git shims”. |
| crates/prek/src/cli/mod.rs | Updates clap help text for install/uninstall/init-templatedir terminology. |
| crates/prek/src/cli/hook_impl.rs | Updates warning/error messages to say “Git shims”. |
| README.md | Updates quick start blurb to say “Git shims”. |
📦 Cargo Bloat ComparisonBinary size change: +0.00% (24.7 MiB → 24.7 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.7 ± 0.1 | 2.5 | 3.0 | 1.00 |
prek-head --version |
2.7 ± 0.2 | 2.5 | 3.7 | 1.00 ± 0.08 |
prek list
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base list |
10.4 ± 0.9 | 9.4 | 13.0 | 1.00 |
prek-head list |
10.5 ± 1.1 | 9.5 | 15.2 | 1.01 ± 0.13 |
prek validate-config .pre-commit-config.yaml
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base validate-config .pre-commit-config.yaml |
3.8 ± 0.6 | 3.4 | 6.0 | 1.03 ± 0.17 |
prek-head validate-config .pre-commit-config.yaml |
3.7 ± 0.3 | 3.3 | 4.4 | 1.00 |
prek sample-config
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base sample-config |
3.1 ± 0.6 | 2.9 | 7.0 | 1.00 ± 0.28 |
prek-head sample-config |
3.1 ± 0.6 | 2.9 | 7.2 | 1.00 |
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 |
171.2 ± 4.0 | 166.8 | 177.7 | 1.00 |
prek-head run --all-files |
174.0 ± 3.7 | 169.3 | 181.2 | 1.02 ± 0.03 |
prek run --all-files (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --all-files |
173.5 ± 6.0 | 164.3 | 186.3 | 1.01 ± 0.05 |
prek-head run --all-files |
171.6 ± 6.3 | 161.5 | 187.9 | 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 |
174.0 ± 5.1 | 163.3 | 184.0 | 1.00 |
prek-head run --all-files |
176.3 ± 29.3 | 163.6 | 374.8 | 1.01 ± 0.17 |
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 |
26.6 ± 2.6 | 23.3 | 34.6 | 1.07 ± 0.12 |
prek-head run trailing-whitespace --all-files |
25.0 ± 1.4 | 23.1 | 27.9 | 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 |
31.7 ± 2.7 | 27.4 | 36.2 | 1.00 |
prek-head run end-of-file-fixer --all-files |
32.0 ± 3.1 | 27.5 | 41.3 | 1.01 ± 0.13 |
prek run check-json --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-json --all-files |
14.7 ± 0.8 | 13.9 | 17.3 | 1.06 ± 0.08 |
prek-head run check-json --all-files |
13.8 ± 0.7 | 12.7 | 16.1 | 1.00 |
prek run check-yaml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-yaml --all-files |
13.1 ± 0.2 | 12.8 | 13.6 | 1.00 |
prek-head run check-yaml --all-files |
13.2 ± 0.4 | 12.7 | 14.5 | 1.01 ± 0.03 |
prek run check-toml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-toml --all-files |
16.4 ± 4.8 | 13.1 | 30.5 | 1.14 ± 0.37 |
prek-head run check-toml --all-files |
14.3 ± 2.0 | 12.9 | 21.5 | 1.00 |
prek run check-xml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-xml --all-files |
14.1 ± 0.9 | 12.7 | 16.8 | 1.03 ± 0.07 |
prek-head run check-xml --all-files |
13.6 ± 0.4 | 12.9 | 14.8 | 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 |
5.6 ± 0.2 | 5.4 | 5.8 | 1.04 ± 0.03 |
prek-head install-hooks |
5.4 ± 0.1 | 5.3 | 5.5 | 1.00 |
prek install-hooks (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base install-hooks |
5.4 ± 0.1 | 5.3 | 5.5 | 1.00 |
prek-head install-hooks |
5.4 ± 0.1 | 5.3 | 5.5 | 1.01 ± 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 |
21.9 ± 1.3 | 20.8 | 25.0 | 1.02 ± 0.07 |
prek-head run |
21.4 ± 0.5 | 20.7 | 23.2 | 1.00 |
prek run --files '*.json' (specific file type)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --files '*.json' |
8.4 ± 0.2 | 8.1 | 8.8 | 1.00 |
prek-head run --files '*.json' |
8.4 ± 0.1 | 8.2 | 8.7 | 1.01 ± 0.02 |
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 |
14.5 ± 1.3 | 13.5 | 17.2 | 1.03 ± 0.10 |
prek-head run --dry-run --all-files |
14.1 ± 0.4 | 13.8 | 15.7 | 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 |
16.1 ± 0.4 | 15.8 | 17.5 | 1.00 ± 0.03 |
prek-head run check-hooks-apply --all-files |
16.0 ± 0.3 | 15.7 | 16.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 |
14.2 ± 0.6 | 13.9 | 16.4 | 1.00 |
prek-head run check-useless-excludes --all-files |
14.5 ± 0.6 | 13.9 | 15.8 | 1.02 ± 0.06 |
prek run identity --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run identity --all-files |
12.6 ± 0.5 | 12.3 | 14.4 | 1.00 |
prek-head run identity --all-files |
12.7 ± 0.6 | 12.3 | 14.7 | 1.01 ± 0.06 |
Closes #1775