Skip to content

Remove hook marker schema 0 - #2622

Merged
j178 merged 4 commits into
masterfrom
drop-hook-schema-v0
Aug 27, 2026
Merged

Remove hook marker schema 0#2622
j178 merged 4 commits into
masterfrom
drop-hook-schema-v0

Conversation

@j178

@j178 j178 commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Drops support for schema 0 hook environment markers.

Copilot AI lite review requested due to automatic review settings August 26, 2026 13:18
@j178 j178 added internal Internal changes breaking Breaking changes labels Aug 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@j178 j178 added internal Internal changes breaking Breaking changes labels Aug 26, 2026
@j178
j178 force-pushed the drop-hook-schema-v0 branch from e2dc982 to c5b8e32 Compare August 26, 2026 13:26
@j178
j178 force-pushed the drop-tracking-bootstrap branch from 1b8726b to e804c97 Compare August 26, 2026 13:26

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread crates/prek/src/hook.rs
};
}))
.unwrap_err();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.99%. Comparing base (e804c97) to head (c5b8e32).

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.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@prek-ci-bot

prek-ci-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

📦 Cargo Bloat Comparison

.text size change: +0.00% (12.5 MiB → 12.5 MiB)

Expand for cargo-bloat output

Head Branch Results

File  .text     Size             Crate Name
0.1%   2.6% 332.0KiB        aws_lc_sys aws_lc_0_44_0_aes_gcm_encrypt_avx512
0.1%   2.6% 332.0KiB        aws_lc_sys aws_lc_0_44_0_aes_gcm_decrypt_avx512
0.0%   0.9% 113.7KiB              prek <prek::cli::Command as clap_builder::derive::Subcommand>::augment_subcommands
0.0%   0.4%  50.6KiB              prek <<prek::config::hook::HookWire as serde_core::de::Deserialize>::deserialize::__Visitor as serde_core::de::Visitor>::visit_map::<<serde_saphyr::de::deserializer::YamlDeserializer as serde_core::de::Deserializer>::deserialize_map::MA>
0.0%   0.4%  48.7KiB annotate_snippets annotate_snippets::renderer::render::render
0.0%   0.4%  47.7KiB              prek prek::run::{closure#0}
0.0%   0.3%  44.1KiB              prek <<prek::config::Config as serde_core::de::Deserialize>::deserialize::__Visitor as serde_core::de::Visitor>::visit_map::<<serde_saphyr::de::deserializer::YamlDeserializer as serde_core::de::Deserializer>::deserialize_map::MA>
0.0%   0.3%  37.1KiB              prek <prek::cli::RunOptions as clap_builder::derive::Args>::augment_args
0.0%   0.3%  33.0KiB              prek prek::cli::run::run::run::{closure#0}
0.0%   0.2%  28.6KiB      serde_saphyr <granit_parser::scanner::Scanner<granit_parser::input::str::StrInput>>::fetch_more_tokens
0.0%   0.2%  28.4KiB              prek prek::archive::unpack::<fs_err::tokio::file::File, &std::path::PathBuf>::{closure#0}
0.0%   0.2%  28.0KiB        aws_lc_sys aws_lc_0_44_0_edwards25519_scalarmuldouble_alt
0.0%   0.2%  27.8KiB      serde_saphyr <granit_parser::scanner::Scanner<granit_parser::input::str::StrInput>>::fetch_more_tokens
0.0%   0.2%  27.5KiB        aws_lc_sys aws_lc_0_44_0_edwards25519_scalarmuldouble
0.0%   0.2%  27.3KiB              toml <toml::de::deserializer::value::ValueDeserializer as serde_core::de::Deserializer>::deserialize_any::<<prek::config::hook::HookWire as serde_core::de::Deserialize>::deserialize::__Visitor>
0.0%   0.2%  27.0KiB              prek prek::archive::unpack::<fs_err::tokio::file::File, &std::path::PathBuf>::{closure#0}
0.0%   0.2%  27.0KiB              prek prek::archive::unpack::<fs_err::tokio::file::File, &std::path::PathBuf>::{closure#0}
0.0%   0.2%  27.0KiB              prek prek::archive::unpack::<fs_err::tokio::file::File, &std::path::PathBuf>::{closure#0}
0.0%   0.2%  26.9KiB              prek prek::archive::unpack::<fs_err::tokio::file::File, &std::path::PathBuf>::{closure#0}
0.0%   0.2%  26.9KiB              prek prek::archive::unpack::<fs_err::tokio::file::File, &std::path::PathBuf>::{closure#0}
4.2%  86.7%  10.8MiB                   And 20303 smaller methods. Use -n N to show more.
4.9% 100.0%  12.5MiB                   .text section size, the file size is 256.8MiB

Base Branch Results

File  .text     Size             Crate Name
0.1%   2.6% 332.0KiB        aws_lc_sys aws_lc_0_44_0_aes_gcm_encrypt_avx512
0.1%   2.6% 332.0KiB        aws_lc_sys aws_lc_0_44_0_aes_gcm_decrypt_avx512
0.0%   0.9% 113.7KiB              prek <prek::cli::Command as clap_builder::derive::Subcommand>::augment_subcommands
0.0%   0.4%  51.4KiB              prek <<prek::config::hook::HookWire as serde_core::de::Deserialize>::deserialize::__Visitor as serde_core::de::Visitor>::visit_map::<<serde_saphyr::de::deserializer::YamlDeserializer as serde_core::de::Deserializer>::deserialize_map::MA>
0.0%   0.4%  48.7KiB annotate_snippets annotate_snippets::renderer::render::render
0.0%   0.3%  44.6KiB              prek <<prek::config::Config as serde_core::de::Deserialize>::deserialize::__Visitor as serde_core::de::Visitor>::visit_map::<<serde_saphyr::de::deserializer::YamlDeserializer as serde_core::de::Deserializer>::deserialize_map::MA>
0.0%   0.3%  44.5KiB              prek prek::run::{closure#0}
0.0%   0.3%  37.1KiB              prek <prek::cli::RunOptions as clap_builder::derive::Args>::augment_args
0.0%   0.3%  33.8KiB              prek <prek::languages::rust::rust::Rust as prek::languages::LanguageBackend>::install::{closure#0}
0.0%   0.3%  33.6KiB              prek prek::cli::run::run::run::{closure#0}
0.0%   0.2%  28.6KiB      serde_saphyr <granit_parser::scanner::Scanner<granit_parser::input::str::StrInput>>::fetch_more_tokens
0.0%   0.2%  28.4KiB              prek prek::archive::unpack::<fs_err::tokio::file::File, &std::path::PathBuf>::{closure#0}
0.0%   0.2%  28.0KiB        aws_lc_sys aws_lc_0_44_0_edwards25519_scalarmuldouble_alt
0.0%   0.2%  27.8KiB      serde_saphyr <granit_parser::scanner::Scanner<granit_parser::input::str::StrInput>>::fetch_more_tokens
0.0%   0.2%  27.5KiB        aws_lc_sys aws_lc_0_44_0_edwards25519_scalarmuldouble
0.0%   0.2%  27.4KiB              toml <toml::de::deserializer::value::ValueDeserializer as serde_core::de::Deserializer>::deserialize_any::<<prek::config::hook::HookWire as serde_core::de::Deserialize>::deserialize::__Visitor>
0.0%   0.2%  27.0KiB              prek prek::archive::unpack::<fs_err::tokio::file::File, &std::path::PathBuf>::{closure#0}
0.0%   0.2%  27.0KiB              prek prek::archive::unpack::<fs_err::tokio::file::File, &std::path::PathBuf>::{closure#0}
0.0%   0.2%  27.0KiB              prek prek::archive::unpack::<fs_err::tokio::file::File, &std::path::PathBuf>::{closure#0}
0.0%   0.2%  27.0KiB              prek prek::archive::unpack::<fs_err::tokio::file::File, &std::path::PathBuf>::{closure#0}
4.2%  86.6%  10.8MiB                   And 20255 smaller methods. Use -n N to show more.
4.9% 100.0%  12.5MiB                   .text section size, the file size is 256.6MiB

@prek-ci-bot

prek-ci-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

⚡️ Hyperfine Benchmarks

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

Environment
  • OS: Linux 6.17.0-1022-azure
  • CPU: 4 cores
  • prek version: prek 0.4.14+33 (4c0cb87 2026-08-26)
  • Rust version: rustc 1.98.0 (88d9e12ae 2026-08-18)
  • 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 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

⚠️ Warning: Performance regression for 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

⚠️ Warning: Performance regression for 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

⚠️ Warning: Performance regression for 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

⚠️ Warning: Performance regression for 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

⚠️ Warning: Performance regression for 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

Base automatically changed from drop-tracking-bootstrap to master August 27, 2026 02:57
@j178
j178 merged commit e63bd4b into master Aug 27, 2026
36 checks passed
@j178
j178 deleted the drop-hook-schema-v0 branch August 27, 2026 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking changes internal Internal changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants