Remove hook marker schema 0 - #2622
Conversation
e2dc982 to
c5b8e32
Compare
1b8726b to
e804c97
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5b8e32033
ℹ️ 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".
| }; | ||
| })) | ||
| .unwrap_err(); | ||
|
|
There was a problem hiding this comment.
Replace
unwrap_err with explicit result matching
This test introduces .unwrap_err() even though the repository guidance explicitly asks contributors to avoid unwraps and encode the failure path explicitly. Match on the deserialization result and assert on the Err value instead, so the test follows the documented control-flow convention.
AGENTS.md reference: AGENTS.md:L10-L12
Useful? React with 👍 / 👎.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## drop-tracking-bootstrap #2622 +/- ##
===========================================================
+ Coverage 93.68% 93.99% +0.30%
===========================================================
Files 140 140
Lines 29534 29460 -74
===========================================================
+ Hits 27670 27691 +21
+ Misses 1864 1769 -95 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
📦 Cargo Bloat Comparison
Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
⚡️ Hyperfine BenchmarksSummary: 5 regressions, 10 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.2 | 1.6 | 2.6 | 1.07 ± 0.13 |
prek-head --version |
1.7 ± 0.1 | 1.5 | 1.9 | 1.00 |
prek list
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base list |
13.8 ± 24.5 | 5.9 | 146.5 | 1.44 ± 3.29 |
prek-head list |
9.6 ± 13.6 | 5.9 | 107.1 | 1.00 |
✅ Performance improvement for prek list: 30.6300% faster
prek validate-config .pre-commit-config.yaml
⏭️ Skipped: .pre-commit-config.yaml not found
prek sample-config
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base sample-config |
4.8 ± 13.2 | 1.7 | 82.8 | 1.00 |
prek-head sample-config |
5.9 ± 13.2 | 1.7 | 75.4 | 1.22 ± 4.28 |
prek sample-config: 21.6400% slower
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 |
25.0 ± 1.3 | 23.1 | 27.2 | 1.00 |
prek-head run --all-files |
27.2 ± 0.8 | 26.3 | 28.7 | 1.09 ± 0.06 |
prek run --all-files (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --all-files |
31.5 ± 26.0 | 23.6 | 141.9 | 1.00 |
prek-head run --all-files |
32.1 ± 25.2 | 22.6 | 126.6 | 1.02 ± 1.16 |
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 |
28.3 ± 21.2 | 22.5 | 174.5 | 1.01 ± 1.08 |
prek-head run --all-files |
27.9 ± 21.1 | 22.4 | 174.0 | 1.00 |
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 |
8.3 ± 0.4 | 7.6 | 9.2 | 1.00 ± 0.10 |
prek-head run trailing-whitespace --all-files |
8.3 ± 0.7 | 7.6 | 10.1 | 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 |
7.2 ± 0.5 | 6.5 | 8.9 | 1.00 |
prek-head run end-of-file-fixer --all-files |
7.4 ± 1.9 | 6.5 | 16.7 | 1.03 ± 0.27 |
prek run check-json --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-json --all-files |
10.0 ± 14.1 | 4.7 | 76.9 | 1.00 |
prek-head run check-json --all-files |
13.9 ± 32.1 | 4.7 | 132.9 | 1.39 ± 3.77 |
prek run check-json --all-files: 39.2500% slower
prek run check-yaml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-yaml --all-files |
6.5 ± 5.4 | 4.8 | 29.1 | 1.00 |
prek-head run check-yaml --all-files |
15.9 ± 31.4 | 4.7 | 129.4 | 2.45 ± 5.24 |
prek run check-yaml --all-files: 144.9600% slower
prek run check-toml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-toml --all-files |
13.1 ± 27.4 | 4.7 | 139.4 | 1.73 ± 4.01 |
prek-head run check-toml --all-files |
7.6 ± 7.7 | 4.8 | 30.8 | 1.00 |
✅ Performance improvement for prek run check-toml --all-files: 42.2000% faster
prek run check-xml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-xml --all-files |
15.2 ± 35.6 | 4.6 | 163.4 | 1.41 ± 4.50 |
prek-head run check-xml --all-files |
10.8 ± 23.5 | 4.6 | 130.1 | 1.00 |
✅ Performance improvement for prek run check-xml --all-files: 28.8700% faster
prek run detect-private-key --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run detect-private-key --all-files |
12.1 ± 15.6 | 6.5 | 82.0 | 1.26 ± 2.10 |
prek-head run detect-private-key --all-files |
9.6 ± 10.0 | 6.4 | 54.4 | 1.00 |
✅ Performance improvement for prek run detect-private-key --all-files: 20.5900% faster
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 |
16.9 ± 25.3 | 8.7 | 126.4 | 1.19 ± 2.48 |
prek-head run fix-byte-order-marker --all-files |
14.2 ± 20.5 | 8.5 | 120.5 | 1.00 |
✅ Performance improvement for prek run fix-byte-order-marker --all-files: 16.0300% faster
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.1 ± 0.1 | 3.0 | 3.3 | 1.03 ± 0.04 |
prek-head install-hooks |
3.0 ± 0.0 | 3.0 | 3.1 | 1.00 |
prek install-hooks (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base install-hooks |
3.6 ± 1.1 | 3.1 | 5.6 | 1.16 ± 0.36 |
prek-head install-hooks |
3.1 ± 0.1 | 3.0 | 3.2 | 1.00 |
✅ Performance improvement for prek install-hooks (warm - with cache): 14.1400% faster
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.8 ± 16.7 | 14.1 | 80.6 | 1.00 |
prek-head run |
28.5 ± 33.9 | 14.3 | 157.2 | 1.31 ± 1.85 |
prek run (staged files only): 30.8900% slower
prek run --files '*.json' (specific file type)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --files '*.json' |
13.5 ± 19.0 | 3.4 | 67.3 | 1.60 ± 3.21 |
prek-head run --files '*.json' |
8.4 ± 12.0 | 3.3 | 46.0 | 1.00 |
✅ Performance improvement for prek run --files '*.json' (specific file type): 37.5100% faster
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 |
18.3 ± 47.1 | 4.4 | 215.3 | 2.51 ± 7.08 |
prek-head run --dry-run --all-files |
7.3 ± 8.5 | 4.9 | 43.0 | 1.00 |
✅ Performance improvement for prek run --dry-run --all-files (measures init overhead): 60.1100% faster
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 |
11.3 ± 16.7 | 5.1 | 62.9 | 1.32 ± 2.69 |
prek-head run check-hooks-apply --all-files |
8.6 ± 12.0 | 5.2 | 51.9 | 1.00 |
✅ Performance improvement for prek run check-hooks-apply --all-files: 24.3800% faster
prek run check-useless-excludes --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-useless-excludes --all-files |
7.0 ± 6.9 | 5.0 | 32.0 | 1.00 |
prek-head run check-useless-excludes --all-files |
9.7 ± 11.5 | 5.1 | 46.3 | 1.39 ± 2.13 |
prek run check-useless-excludes --all-files: 38.6200% slower
prek run identity --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run identity --all-files |
41.7 ± 53.4 | 4.5 | 129.1 | 5.46 ± 9.15 |
prek-head run identity --all-files |
7.6 ± 8.3 | 4.5 | 36.8 | 1.00 |
✅ Performance improvement for prek run identity --all-files: 81.6800% faster
Drops support for schema 0 hook environment markers.