Skip to content

Disambiguate “hook” terminology by renaming "Git hooks" to "Git shims"#1776

Merged
j178 merged 1 commit intomasterfrom
hook-term
Mar 11, 2026
Merged

Disambiguate “hook” terminology by renaming "Git hooks" to "Git shims"#1776
j178 merged 1 commit intomasterfrom
hook-term

Conversation

@j178
Copy link
Copy Markdown
Owner

@j178 j178 commented Mar 11, 2026

Closes #1775

Copilot AI review requested due to automatic review settings March 11, 2026 03:06
@j178 j178 added the documentation Improvements or additions to documentation label Mar 11, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.66%. Comparing base (5b456bc) to head (7aad939).
⚠️ Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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”.

@prek-ci-bot
Copy link
Copy Markdown

prek-ci-bot bot commented Mar 11, 2026

📦 Cargo Bloat Comparison

Binary size change: +0.00% (24.7 MiB → 24.7 MiB)

Expand for cargo-bloat output

Head Branch Results

 File  .text     Size             Crate Name
 1.3%   2.7% 332.0KiB        aws_lc_sys aws_lc_0_38_0_aes_gcm_encrypt_avx512
 1.3%   2.7% 332.0KiB        aws_lc_sys aws_lc_0_38_0_aes_gcm_decrypt_avx512
 0.3%   0.6%  77.0KiB              prek prek::languages::<impl prek::config::Language>::run::{{closure}}::{{closure}}
 0.3%   0.6%  69.8KiB              prek prek::languages::<impl prek::config::Language>::run::{{closure}}::{{closure}}
 0.3%   0.6%  68.0KiB             prek? <prek::cli::Command as clap_builder::derive::Subcommand>::augment_subcommands
 0.2%   0.4%  51.0KiB annotate_snippets annotate_snippets::renderer::render::render
 0.2%   0.4%  50.6KiB              prek prek::languages::<impl prek::config::Language>::install::{{closure}}
 0.2%   0.4%  46.8KiB              prek prek::run::{{closure}}
 0.2%   0.3%  41.8KiB              prek prek::cli::run::run::run::{{closure}}
 0.1%   0.3%  32.0KiB             prek? <prek::cli::RunArgs as clap_builder::derive::Args>::augment_args
 0.1%   0.2%  28.0KiB        aws_lc_sys aws_lc_0_38_0_edwards25519_scalarmuldouble_alt
 0.1%   0.2%  27.8KiB      serde_saphyr saphyr_parser_bw::scanner::Scanner<T>::fetch_more_tokens
 0.1%   0.2%  27.5KiB        aws_lc_sys aws_lc_0_38_0_edwards25519_scalarmuldouble
 0.1%   0.2%  25.8KiB              prek prek::cli::try_repo::try_repo::{{closure}}
 0.1%   0.2%  24.9KiB             prek? <prek::config::_::<impl serde_core::de::Deserialize for prek::config::Config>::deserialize::__Visitor as serde_core::de::Visitor>::visit_map
 0.1%   0.2%  23.0KiB              prek prek::hooks::meta_hooks::MetaHooks::run::{{closure}}
 0.1%   0.2%  22.4KiB      serde_saphyr saphyr_parser_bw::scanner::Scanner<T>::fetch_more_tokens
 0.1%   0.2%  22.3KiB         [Unknown] Lp384_montjscalarmul_alt_p384_montjadd
 0.1%   0.2%  22.0KiB               std core::ptr::drop_in_place<prek::languages::<impl prek::config::Language>::install::{{closure}}>
 0.1%   0.2%  21.6KiB              prek prek::workspace::Project::init_hooks::{{closure}}
41.1%  86.0%  10.2MiB                   And 23261 smaller methods. Use -n N to show more.
47.8% 100.0%  11.8MiB                   .text section size, the file size is 24.7MiB

Base Branch Results

 File  .text     Size             Crate Name
 1.3%   2.7% 332.0KiB        aws_lc_sys aws_lc_0_38_0_aes_gcm_encrypt_avx512
 1.3%   2.7% 332.0KiB        aws_lc_sys aws_lc_0_38_0_aes_gcm_decrypt_avx512
 0.3%   0.6%  77.0KiB              prek prek::languages::<impl prek::config::Language>::run::{{closure}}::{{closure}}
 0.3%   0.6%  69.8KiB              prek prek::languages::<impl prek::config::Language>::run::{{closure}}::{{closure}}
 0.3%   0.6%  68.0KiB             prek? <prek::cli::Command as clap_builder::derive::Subcommand>::augment_subcommands
 0.2%   0.4%  51.0KiB annotate_snippets annotate_snippets::renderer::render::render
 0.2%   0.4%  50.6KiB              prek prek::languages::<impl prek::config::Language>::install::{{closure}}
 0.2%   0.4%  46.8KiB              prek prek::run::{{closure}}
 0.2%   0.3%  41.8KiB              prek prek::cli::run::run::run::{{closure}}
 0.1%   0.3%  32.0KiB             prek? <prek::cli::RunArgs as clap_builder::derive::Args>::augment_args
 0.1%   0.2%  28.0KiB        aws_lc_sys aws_lc_0_38_0_edwards25519_scalarmuldouble_alt
 0.1%   0.2%  27.8KiB      serde_saphyr saphyr_parser_bw::scanner::Scanner<T>::fetch_more_tokens
 0.1%   0.2%  27.5KiB        aws_lc_sys aws_lc_0_38_0_edwards25519_scalarmuldouble
 0.1%   0.2%  25.8KiB              prek prek::cli::try_repo::try_repo::{{closure}}
 0.1%   0.2%  24.9KiB             prek? <prek::config::_::<impl serde_core::de::Deserialize for prek::config::Config>::deserialize::__Visitor as serde_core::de::Visitor>::visit_map
 0.1%   0.2%  23.0KiB              prek prek::hooks::meta_hooks::MetaHooks::run::{{closure}}
 0.1%   0.2%  22.4KiB      serde_saphyr saphyr_parser_bw::scanner::Scanner<T>::fetch_more_tokens
 0.1%   0.2%  22.3KiB         [Unknown] Lp384_montjscalarmul_alt_p384_montjadd
 0.1%   0.2%  22.0KiB               std core::ptr::drop_in_place<prek::languages::<impl prek::config::Language>::install::{{closure}}>
 0.1%   0.2%  21.6KiB              prek prek::workspace::Project::init_hooks::{{closure}}
41.1%  86.0%  10.2MiB                   And 23261 smaller methods. Use -n N to show more.
47.8% 100.0%  11.8MiB                   .text section size, the file size is 24.7MiB

@prek-ci-bot
Copy link
Copy Markdown

prek-ci-bot bot commented Mar 11, 2026

⚡️ Hyperfine Benchmarks

Summary: 0 regressions, 0 improvements above the 10% threshold.

Environment
  • OS: Linux 6.14.0-1017-azure
  • CPU: 4 cores
  • prek version: prek 0.3.5+12 (541eaf9 2026-03-11)
  • Rust version: rustc 1.94.0 (4a4ef493e 2026-03-02)
  • Hyperfine version: hyperfine 1.20.0
CLI Commands

Benchmarking basic commands in the main repo:

prek --version

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

Copilot AI review requested due to automatic review settings March 11, 2026 03:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

@j178 j178 merged commit 4ed4e86 into master Mar 11, 2026
51 checks passed
@j178 j178 deleted the hook-term branch March 11, 2026 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation for prek install is unclear; mixed use of prek hooks and git hooks

2 participants