Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2286 +/- ##
==========================================
+ Coverage 93.11% 93.12% +0.01%
==========================================
Files 127 127
Lines 27991 28051 +60
==========================================
+ Hits 26063 26122 +59
- Misses 1928 1929 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR renames the CLI command prek auto-update to prek update, while keeping backwards-compatible command and config key aliases, and updates the surrounding docs, schema, and tests to match.
Changes:
- Rename the CLI subcommand to
updatewhile retaining legacy aliases (auto-update,autoupdate). - Rename configuration keys from
auto_update.*toupdate.*while keepingauto_updateas a deserialization alias. - Update documentation pages, the published JSON schema, and snapshots/integration tests to reflect the new naming.
Reviewed changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates documentation references from auto-update to update. |
| prek.schema.json | Renames the documented config section from auto_update to update. |
| docs/usage.md | Updates example usage to prek update. |
| docs/reference/configuration.md | Renames documented config keys to update.* and documents compatibility aliases. |
| docs/reference/cli.md | Updates CLI reference section/anchors/options from auto-update to update. |
| docs/diff.md | Updates “Difference from pre-commit” command description from auto-update to update. |
| docs/configuration.md | Updates links/compat notes to update.cooldown_days. |
| docs/compatibility.md | Updates compatibility table for new preferred command/config spellings. |
| docs/authoring-hooks.md | Updates hook authoring guidance to refer to prek update. |
| crates/prek/tests/update.rs | Renames integration tests and command invocations to update. |
| crates/prek/tests/run.rs | Updates completion snapshot content to show update. |
| crates/prek/tests/global_config.rs | Updates global-config tests to call update and adds a legacy alias check. |
| crates/prek/tests/common/mod.rs | Renames the TestContext helper from auto_update() to update(). |
| crates/prek/src/snapshots/prek__config__tests__read_yaml_config.snap | Updates config debug snapshot field name to update. |
| crates/prek/src/snapshots/prek__config__tests__read_toml_config.snap | Updates config debug snapshot field name to update. |
| crates/prek/src/snapshots/prek__config__tests__read_config_with_nested_merge_keys.snap | Updates config debug snapshot field name to update. |
| crates/prek/src/snapshots/prek__config__tests__read_config_with_merge_keys.snap | Updates config debug snapshot field name to update. |
| crates/prek/src/snapshots/prek__config__tests__parse_repos.snap | Updates config debug snapshot field name to update. |
| crates/prek/src/snapshots/prek__config__tests__parse_repos-6.snap | Updates config debug snapshot field name to update. |
| crates/prek/src/snapshots/prek__config__tests__parse_repos-4.snap | Updates config debug snapshot field name to update. |
| crates/prek/src/snapshots/prek__config__tests__parse_repos-3.snap | Updates config debug snapshot field name to update. |
| crates/prek/src/snapshots/prek__config__tests__parse_hooks-3.snap | Updates config debug snapshot field name to update. |
| crates/prek/src/snapshots/prek__config__tests__numeric_rev_is_parsed_as_string.snap | Updates config debug snapshot field name to update. |
| crates/prek/src/snapshots/prek__config__tests__meta_hooks-5.snap | Updates config debug snapshot field name to update. |
| crates/prek/src/snapshots/prek__config__tests__language_version.snap | Updates config debug snapshot field name to update. |
| crates/prek/src/settings.rs | Renames global-config options to update with serde alias support and adds unit tests for aliases. |
| crates/prek/src/main.rs | Switches CLI dispatch from AutoUpdate to Update. |
| crates/prek/src/hook.rs | Updates test config struct field name to update. |
| crates/prek/src/config.rs | Renames config options/types to UpdateOptions, adds serde alias for auto_update, updates hint text, and adds alias parsing tests. |
| crates/prek/src/cli/update/source.rs | Updates imports and settings resolution to use UpdateSettings and config.update. |
| crates/prek/src/cli/update/repository.rs | Updates module path imports and docstrings to prek update. |
| crates/prek/src/cli/update/mod.rs | Renames the primary entrypoint from auto_update to update and switches reporter type. |
| crates/prek/src/cli/update/display.rs | Updates imports to the update module path. |
| crates/prek/src/cli/update/config.rs | Updates test imports to reference the update module. |
| crates/prek/src/cli/reporter.rs | Renames AutoUpdateReporter to UpdateReporter. |
| crates/prek/src/cli/mod.rs | Replaces the subcommand variant with Update(UpdateArgs) and wires legacy aliases. |
📦 Cargo Bloat ComparisonBinary size change: +0.00% (26.7 MiB → 26.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.3 ± 0.2 | 2.1 | 3.1 | 1.08 ± 0.11 |
prek-head --version |
2.1 ± 0.1 | 2.0 | 3.0 | 1.00 |
prek list
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base list |
9.3 ± 0.4 | 9.0 | 13.0 | 1.03 ± 0.05 |
prek-head list |
9.1 ± 0.1 | 8.7 | 9.7 | 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.2 ± 0.1 | 3.1 | 3.5 | 1.06 ± 0.16 |
prek-head validate-config .pre-commit-config.yaml |
3.0 ± 0.4 | 2.9 | 6.1 | 1.00 |
prek sample-config
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base sample-config |
2.5 ± 0.1 | 2.4 | 3.1 | 1.06 ± 0.04 |
prek-head sample-config |
2.4 ± 0.0 | 2.3 | 2.5 | 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 |
74.9 ± 2.7 | 70.2 | 78.0 | 1.03 ± 0.05 |
prek-head run --all-files |
73.1 ± 2.2 | 68.9 | 75.6 | 1.00 |
prek run --all-files (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --all-files |
74.3 ± 4.3 | 69.9 | 88.0 | 1.03 ± 0.07 |
prek-head run --all-files |
72.0 ± 2.4 | 68.3 | 77.5 | 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 |
72.0 ± 2.5 | 67.3 | 77.2 | 1.00 |
prek-head run --all-files |
72.1 ± 2.4 | 68.0 | 77.7 | 1.00 ± 0.05 |
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.0 ± 1.3 | 18.7 | 24.1 | 1.06 ± 0.08 |
prek-head run trailing-whitespace --all-files |
19.0 ± 0.6 | 18.2 | 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 |
25.6 ± 1.9 | 23.2 | 29.9 | 1.00 |
prek-head run end-of-file-fixer --all-files |
26.0 ± 2.4 | 23.1 | 31.0 | 1.02 ± 0.12 |
prek run check-json --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-json --all-files |
7.9 ± 0.5 | 7.3 | 10.0 | 1.04 ± 0.08 |
prek-head run check-json --all-files |
7.6 ± 0.3 | 7.0 | 8.4 | 1.00 |
prek run check-yaml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-yaml --all-files |
7.5 ± 0.2 | 7.1 | 7.9 | 1.05 ± 0.04 |
prek-head run check-yaml --all-files |
7.1 ± 0.2 | 6.9 | 7.6 | 1.00 |
prek run check-toml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-toml --all-files |
7.6 ± 0.3 | 6.9 | 8.3 | 1.05 ± 0.06 |
prek-head run check-toml --all-files |
7.2 ± 0.3 | 6.6 | 8.2 | 1.00 |
prek run check-xml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-xml --all-files |
7.6 ± 0.3 | 7.0 | 8.2 | 1.03 ± 0.06 |
prek-head run check-xml --all-files |
7.4 ± 0.3 | 6.9 | 8.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.3 ± 1.1 | 11.6 | 15.9 | 1.00 |
prek-head run detect-private-key --all-files |
13.3 ± 1.3 | 11.4 | 16.6 | 1.00 ± 0.13 |
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 |
17.6 ± 1.2 | 16.1 | 20.0 | 1.02 ± 0.09 |
prek-head run fix-byte-order-marker --all-files |
17.3 ± 1.0 | 15.9 | 20.3 | 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.5 ± 0.1 | 4.5 | 4.8 | 1.08 ± 0.03 |
prek-head install-hooks |
4.2 ± 0.0 | 4.2 | 4.3 | 1.00 |
prek install-hooks (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base install-hooks |
4.4 ± 0.0 | 4.4 | 4.5 | 1.03 ± 0.02 |
prek-head install-hooks |
4.3 ± 0.1 | 4.2 | 4.4 | 1.00 |
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 |
36.7 ± 1.1 | 35.4 | 39.8 | 1.00 ± 0.04 |
prek-head run |
36.7 ± 1.2 | 35.3 | 40.1 | 1.00 |
prek run --files '*.json' (specific file type)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --files '*.json' |
7.8 ± 0.1 | 7.6 | 8.1 | 1.00 |
prek-head run --files '*.json' |
7.9 ± 0.2 | 7.6 | 8.4 | 1.01 ± 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 |
6.9 ± 0.2 | 6.7 | 7.6 | 1.06 ± 0.04 |
prek-head run --dry-run --all-files |
6.6 ± 0.2 | 6.3 | 6.9 | 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 |
11.9 ± 0.2 | 11.6 | 12.3 | 1.05 ± 0.02 |
prek-head run check-hooks-apply --all-files |
11.3 ± 0.1 | 11.2 | 11.4 | 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 |
10.4 ± 0.1 | 10.3 | 10.6 | 1.03 ± 0.01 |
prek-head run check-useless-excludes --all-files |
10.1 ± 0.1 | 10.0 | 10.2 | 1.00 |
prek run identity --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run identity --all-files |
9.6 ± 0.1 | 9.4 | 9.8 | 1.02 ± 0.02 |
prek-head run identity --all-files |
9.5 ± 0.1 | 9.3 | 9.8 | 1.00 |
Summary
prek auto-updatetoprek update