Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2055 +/- ##
========================================
Coverage 92.32% 92.32%
========================================
Files 119 119
Lines 24320 24429 +109
========================================
+ Hits 22453 22555 +102
- Misses 1867 1874 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a54b0394c0
ℹ️ 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".
📦 Cargo Bloat ComparisonBinary size change: -0.76% (26.3 MiB → 26.1 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.5 ± 0.1 | 2.4 | 3.4 | 1.03 ± 0.07 |
prek-head --version |
2.4 ± 0.1 | 2.3 | 2.7 | 1.00 |
prek list
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base list |
9.4 ± 0.2 | 9.1 | 10.2 | 1.00 |
prek-head list |
9.5 ± 0.2 | 9.1 | 10.3 | 1.00 ± 0.04 |
prek validate-config .pre-commit-config.yaml
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base validate-config .pre-commit-config.yaml |
3.4 ± 0.1 | 3.3 | 3.5 | 1.00 |
prek-head validate-config .pre-commit-config.yaml |
3.4 ± 0.1 | 3.3 | 3.8 | 1.01 ± 0.04 |
prek sample-config
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base sample-config |
2.8 ± 0.1 | 2.6 | 2.9 | 1.00 |
prek-head sample-config |
2.8 ± 0.1 | 2.6 | 3.1 | 1.02 ± 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 |
145.0 ± 2.7 | 141.4 | 151.1 | 1.00 ± 0.03 |
prek-head run --all-files |
144.3 ± 3.4 | 141.0 | 149.4 | 1.00 |
prek run --all-files (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --all-files |
144.4 ± 4.0 | 139.6 | 150.7 | 1.01 ± 0.04 |
prek-head run --all-files |
143.4 ± 3.6 | 139.4 | 151.7 | 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 |
144.6 ± 3.7 | 138.3 | 153.1 | 1.00 |
prek-head run --all-files |
145.4 ± 3.6 | 139.1 | 152.5 | 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 |
21.5 ± 1.0 | 20.5 | 24.9 | 1.03 ± 0.05 |
prek-head run trailing-whitespace --all-files |
21.0 ± 0.5 | 20.3 | 22.3 | 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 |
28.3 ± 2.4 | 24.7 | 32.5 | 1.01 ± 0.15 |
prek-head run end-of-file-fixer --all-files |
28.1 ± 3.3 | 23.6 | 39.9 | 1.00 |
prek run check-json --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-json --all-files |
13.0 ± 0.3 | 12.4 | 13.6 | 1.08 ± 0.04 |
prek-head run check-json --all-files |
12.0 ± 0.3 | 11.6 | 12.7 | 1.00 |
prek run check-yaml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-yaml --all-files |
12.3 ± 0.4 | 11.6 | 13.0 | 1.00 ± 0.09 |
prek-head run check-yaml --all-files |
12.2 ± 1.0 | 11.4 | 16.7 | 1.00 |
prek run check-toml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-toml --all-files |
12.1 ± 0.3 | 11.6 | 12.8 | 1.00 ± 0.04 |
prek-head run check-toml --all-files |
12.1 ± 0.3 | 11.6 | 12.8 | 1.00 |
prek run check-xml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-xml --all-files |
13.1 ± 6.2 | 11.6 | 45.9 | 1.06 ± 0.50 |
prek-head run check-xml --all-files |
12.4 ± 0.4 | 11.5 | 13.0 | 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 |
18.4 ± 1.2 | 16.3 | 20.4 | 1.04 ± 0.10 |
prek-head run detect-private-key --all-files |
17.7 ± 1.2 | 15.9 | 19.6 | 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 |
22.8 ± 1.7 | 19.7 | 25.1 | 1.01 ± 0.10 |
prek-head run fix-byte-order-marker --all-files |
22.7 ± 1.6 | 20.2 | 25.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 |
4.9 ± 0.1 | 4.9 | 5.0 | 1.00 |
prek-head install-hooks |
4.9 ± 0.1 | 4.8 | 5.0 | 1.00 ± 0.02 |
prek install-hooks (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base install-hooks |
4.9 ± 0.1 | 4.8 | 5.0 | 1.00 |
prek-head install-hooks |
4.9 ± 0.1 | 4.8 | 5.0 | 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 |
50.7 ± 0.8 | 49.3 | 52.0 | 1.00 ± 0.03 |
prek-head run |
50.6 ± 1.0 | 49.0 | 52.5 | 1.00 |
prek run --files '*.json' (specific file type)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --files '*.json' |
8.8 ± 0.1 | 8.6 | 9.2 | 1.01 ± 0.02 |
prek-head run --files '*.json' |
8.7 ± 0.1 | 8.5 | 8.9 | 1.00 |
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 |
10.9 ± 0.1 | 10.7 | 11.1 | 1.00 |
prek-head run --dry-run --all-files |
11.0 ± 0.2 | 10.8 | 11.5 | 1.00 ± 0.02 |
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 |
13.5 ± 0.1 | 13.3 | 13.8 | 1.00 |
prek-head run check-hooks-apply --all-files |
13.6 ± 0.5 | 12.1 | 14.0 | 1.01 ± 0.04 |
prek run check-useless-excludes --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-useless-excludes --all-files |
11.9 ± 0.1 | 11.7 | 12.2 | 1.00 |
prek-head run check-useless-excludes --all-files |
12.0 ± 0.2 | 11.6 | 12.5 | 1.01 ± 0.02 |
prek run identity --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run identity --all-files |
10.8 ± 0.1 | 10.7 | 10.9 | 1.00 |
prek-head run identity --all-files |
11.2 ± 0.3 | 10.9 | 11.7 | 1.04 ± 0.03 |
There was a problem hiding this comment.
Pull request overview
This PR fixes an auto-update edge case where --cooldown-days could “update” a repository to an older tag than the currently pinned rev. It introduces explicit downgrade prevention (with user-facing messaging), adds regression tests, and documents the behavior in the CLI/config references.
Changes:
- Prevent cooldown-based revision selection from replacing a newer current
revwith an older cooldown-eligible tag (skip + report instead). - Add display/output plumbing to surface “skipped downgrade” events to the user.
- Update documentation and add integration/unit tests covering the downgrade-prevention behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| docs/reference/configuration.md | Documents cooldown precedence and explicitly states cooldowns never downgrade; improves intra-doc links/anchors. |
| docs/reference/cli.md | Updates --cooldown-days help text to describe the non-downgrade behavior. |
| docs/configuration.md | Replaces duplicated prose with a link to the configuration reference section. |
| crates/prek/tests/auto_update.rs | Adds an end-to-end regression test ensuring cooldown does not downgrade the pinned rev. |
| crates/prek/src/cli/mod.rs | Updates clap help text for --cooldown-days to match the new behavior. |
| crates/prek/src/cli/auto_update/source.rs | Threads the new revision selection result (RevisionSelection) through target evaluation and preserves skip metadata. |
| crates/prek/src/cli/auto_update/repository.rs | Implements downgrade detection vs current pin during cooldown selection; refactors tag ordering comparator; updates tests accordingly. |
| crates/prek/src/cli/auto_update/mod.rs | Introduces RevisionSelection / SkippedDowngrade types and stores skipped-downgrade metadata in resolved updates. |
| crates/prek/src/cli/auto_update/display.rs | Adds formatting and emission of “skipped downgrade” messages and suppresses redundant verbose “up to date” output in that case. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e4dfae43d
ℹ️ 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".
Closes #2051.
This prevents
prek auto-update --cooldown-daysfrom replacing a newer currentrevwith an older rev selected by the cooldown window. It also reports the skipped downgrade and documents the behavior.