Skip to content

Restore using serde_yaml in check-yaml hook#1106

Merged
j178 merged 3 commits intomasterfrom
fix-check-yaml
Nov 18, 2025
Merged

Restore using serde_yaml in check-yaml hook#1106
j178 merged 3 commits intomasterfrom
fix-check-yaml

Conversation

@j178
Copy link
Owner

@j178 j178 commented Nov 18, 2025

Before I figure out how to make serde_saphyr deserialize into Value with bytes support, revert back to using serde_yaml in the check_yaml hook.

Closes #1104
Closes #1102

@j178 j178 added the bug Something isn't working label Nov 18, 2025
@j178 j178 changed the title Fix check-yaml: do not try to parse !!binary scalar into UTF-8 string Fix check-yaml: do not try to parse !!binary scalar into UTF-8 string Nov 18, 2025
@codecov
Copy link

codecov bot commented Nov 18, 2025

Codecov Report

❌ Patch coverage is 90.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.85%. Comparing base (ed7c024) to head (e6acd27).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/builtin/pre_commit_hooks/check_yaml.rs 90.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1106      +/-   ##
==========================================
+ Coverage   89.82%   89.85%   +0.03%     
==========================================
  Files          72       72              
  Lines       13392    13432      +40     
==========================================
+ Hits        12029    12069      +40     
  Misses       1363     1363              

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

@github-actions
Copy link

github-actions bot commented Nov 18, 2025

📦 Cargo Bloat Comparison

Binary size change: +0.61% (16.5 MiB → 16.6 MiB)

Expand for cargo-bloat output

Head Branch Results

 File  .text     Size          Crate Name
 0.6%   1.3% 101.3KiB          prek? <prek::cli::Command as clap_builder::derive::Subcommand>::augment_subcommands
 0.6%   1.2%  97.7KiB           prek prek::builtin::pre_commit_hooks::Implemented::run::{{closure}}
 0.6%   1.2%  94.7KiB           prek prek::languages::<impl prek::config::Language>::run::{{closure}}
 0.3%   0.7%  54.6KiB           prek prek::archive::unpack::{{closure}}
 0.3%   0.6%  48.8KiB           prek prek::run::{{closure}}
 0.2%   0.5%  41.3KiB           prek prek::languages::<impl prek::config::Language>::install::{{closure}}
 0.2%   0.5%  39.1KiB          prek? <prek::cli::RunArgs as clap_builder::derive::Args>::augment_args
 0.2%   0.5%  37.3KiB regex_automata regex_automata::meta::strategy::new
 0.2%   0.4%  32.5KiB             h2 h2::proto::connection::Connection<T,P,B>::poll
 0.2%   0.4%  32.3KiB           prek prek::languages::node::installer::NodeInstaller::install::{{closure}}
 0.2%   0.4%  31.9KiB             h2 h2::proto::connection::DynConnection<B>::recv_frame
 0.2%   0.4%  31.8KiB           prek prek::workspace::Workspace::discover
 0.2%   0.4%  30.5KiB           prek prek::cli::run::run::run::{{closure}}
 0.2%   0.3%  27.6KiB           prek prek::identify::by_extension::{{closure}}
 0.1%   0.3%  25.5KiB     hyper_util hyper_util::client::legacy::client::Client<C,B>::connect_to::{{closure}}::{{closure}}::{{closure}}
 0.1%   0.3%  25.3KiB           prek prek::hook::HookBuilder::build::{{closure}}
 0.1%   0.3%  25.1KiB           prek prek::main
 0.1%   0.3%  24.9KiB     hyper_util hyper_util::client::legacy::client::Client<C,B>::send_request::{{closure}}
 0.1%   0.3%  24.6KiB           prek prek::cli::auto_update::auto_update::{{closure}}
 0.1%   0.3%  24.2KiB           prek prek::languages::golang::installer::GoInstaller::install::{{closure}}
41.0%  88.3%   6.8MiB                And 10426 smaller methods. Use -n N to show more.
46.4% 100.0%   7.7MiB                .text section size, the file size is 16.6MiB

Base Branch Results

 File  .text     Size          Crate Name
 0.6%   1.3% 101.3KiB          prek? <prek::cli::Command as clap_builder::derive::Subcommand>::augment_subcommands
 0.6%   1.3% 100.0KiB           prek prek::builtin::pre_commit_hooks::Implemented::run::{{closure}}
 0.6%   1.2%  94.7KiB           prek prek::languages::<impl prek::config::Language>::run::{{closure}}
 0.3%   0.7%  54.6KiB           prek prek::archive::unpack::{{closure}}
 0.3%   0.6%  48.8KiB           prek prek::run::{{closure}}
 0.2%   0.5%  41.1KiB           prek prek::languages::<impl prek::config::Language>::install::{{closure}}
 0.2%   0.5%  39.1KiB          prek? <prek::cli::RunArgs as clap_builder::derive::Args>::augment_args
 0.2%   0.5%  37.3KiB regex_automata regex_automata::meta::strategy::new
 0.2%   0.4%  32.5KiB             h2 h2::proto::connection::Connection<T,P,B>::poll
 0.2%   0.4%  32.3KiB           prek prek::languages::node::installer::NodeInstaller::install::{{closure}}
 0.2%   0.4%  31.9KiB             h2 h2::proto::connection::DynConnection<B>::recv_frame
 0.2%   0.4%  31.8KiB           prek prek::workspace::Workspace::discover
 0.2%   0.4%  30.5KiB           prek prek::cli::run::run::run::{{closure}}
 0.2%   0.4%  27.6KiB           prek prek::identify::by_extension::{{closure}}
 0.2%   0.3%  25.5KiB     hyper_util hyper_util::client::legacy::client::Client<C,B>::connect_to::{{closure}}::{{closure}}::{{closure}}
 0.2%   0.3%  25.3KiB           prek prek::hook::HookBuilder::build::{{closure}}
 0.1%   0.3%  25.1KiB           prek prek::main
 0.1%   0.3%  24.9KiB     hyper_util hyper_util::client::legacy::client::Client<C,B>::send_request::{{closure}}
 0.1%   0.3%  24.6KiB           prek prek::cli::auto_update::auto_update::{{closure}}
 0.1%   0.3%  24.2KiB           prek prek::languages::golang::installer::GoInstaller::install::{{closure}}
40.7%  88.1%   6.7MiB                And 10301 smaller methods. Use -n N to show more.
46.2% 100.0%   7.6MiB                .text section size, the file size is 16.5MiB

@j178 j178 changed the title Fix check-yaml: do not try to parse !!binary scalar into UTF-8 string Restore using serde_yaml in check-yaml hook Nov 18, 2025
@j178 j178 merged commit aed7e55 into master Nov 18, 2025
21 checks passed
@j178 j178 deleted the fix-check-yaml branch November 18, 2025 09:25
j178 added a commit that referenced this pull request Feb 2, 2026
serde-saphyr has way better error message, and it is written in safe
Rust.

Previous try: #1087
Previous revert: #1106 and #1112

TODO:
Replace serialize_yaml_scalar with serde-saphyr as well:


https://github.com/j178/prek/blob/0a4be22599076b8c6273940b2760828b442c78f4/crates/prek/src/yaml.rs#L12-L13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed to yaml decode from prek==0.2.15 on VCR cassettes switching to serde_saphyr seems to cause hook to fail

1 participant