Skip to content

Conversation

@branchv
Copy link
Contributor

@branchv branchv commented Jan 2, 2026

Adding support for https://github.com/apple/container as a container runtime. As a newer project, it's not yet 100% docker-compatible so needed some special casing (missing --volume's Z option and --init)

Example:

$ PREK_CONTAINER_RUNTIME=container cargo run -- try-repo https://github.com/gitleaks/gitleaks gitleaks-docker -a
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.14s
     Running `target/debug/prek try-repo 'https://github.com/gitleaks/gitleaks' gitleaks-docker -a`
Using config:
repos:
  - repo: https://github.com/gitleaks/gitleaks
    rev: b66ac75e4fa93d86d78fccd6e2f36d2c0698b2a2
    hooks:
      - id: gitleaks-docker
Detect hardcoded secrets.................................................Passed

@codecov
Copy link

codecov bot commented Jan 2, 2026

Codecov Report

❌ Patch coverage is 91.30435% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.99%. Comparing base (4033c80) to head (9302837).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
crates/prek/src/languages/docker.rs 91.30% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1306      +/-   ##
==========================================
- Coverage   90.00%   89.99%   -0.01%     
==========================================
  Files          80       80              
  Lines       15881    15918      +37     
==========================================
+ Hits        14293    14325      +32     
- Misses       1588     1593       +5     

☔ 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 Jan 2, 2026

📦 Cargo Bloat Comparison

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

Expand for cargo-bloat output

Head Branch Results

 File  .text     Size          Crate Name
 0.7%   1.5% 115.5KiB           prek prek::languages::<impl prek::config::Language>::run::{{closure}}::{{closure}}
 0.6%   1.3% 107.3KiB          prek? <prek::cli::Command as clap_builder::derive::Subcommand>::augment_subcommands
 0.3%   0.7%  54.7KiB           prek prek::archive::unpack::{{closure}}
 0.3%   0.7%  52.8KiB             h2 h2::proto::connection::Connection<T,P,B>::poll
 0.2%   0.5%  39.8KiB           prek prek::languages::<impl prek::config::Language>::install::{{closure}}
 0.2%   0.5%  39.2KiB          prek? <prek::cli::RunArgs as clap_builder::derive::Args>::augment_args
 0.2%   0.5%  39.2KiB           prek prek::run::{{closure}}
 0.2%   0.5%  37.3KiB          hyper hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_loop
 0.2%   0.5%  36.9KiB regex_automata regex_automata::meta::strategy::new
 0.2%   0.5%  36.5KiB           prek prek::workspace::Workspace::discover
 0.2%   0.4%  30.8KiB           std? <core::marker::PhantomData<T> as serde_core::de::DeserializeSeed>::deserialize
 0.2%   0.4%  30.7KiB           prek prek::cli::run::run::run::{{closure}}
 0.2%   0.4%  29.8KiB           prek prek::languages::rust::installer::RustInstaller::install::{{closure}}
 0.2%   0.4%  28.4KiB           prek prek::languages::node::installer::NodeInstaller::install::{{closure}}
 0.2%   0.4%  27.9KiB             h2 h2::proto::connection::DynConnection<B>::recv_frame
 0.2%   0.3%  27.6KiB           prek prek::identify::by_extension::{{closure}}
 0.2%   0.3%  27.3KiB           prek prek::cli::run::run::run_hooks::{{closure}}
 0.2%   0.3%  26.2KiB           prek prek::cli::auto_update::update_repo::{{closure}}
 0.1%   0.3%  25.3KiB           prek prek::main
 0.1%   0.3%  24.7KiB           prek prek::hook::HookBuilder::build::{{closure}}
41.2%  88.5%   6.9MiB                And 10639 smaller methods. Use -n N to show more.
46.5% 100.0%   7.8MiB                .text section size, the file size is 16.7MiB

Base Branch Results

 File  .text     Size          Crate Name
 0.7%   1.5% 115.5KiB           prek prek::languages::<impl prek::config::Language>::run::{{closure}}::{{closure}}
 0.6%   1.3% 107.3KiB          prek? <prek::cli::Command as clap_builder::derive::Subcommand>::augment_subcommands
 0.3%   0.7%  54.7KiB           prek prek::archive::unpack::{{closure}}
 0.3%   0.7%  52.8KiB             h2 h2::proto::connection::Connection<T,P,B>::poll
 0.2%   0.5%  39.8KiB           prek prek::languages::<impl prek::config::Language>::install::{{closure}}
 0.2%   0.5%  39.2KiB          prek? <prek::cli::RunArgs as clap_builder::derive::Args>::augment_args
 0.2%   0.5%  39.2KiB           prek prek::run::{{closure}}
 0.2%   0.5%  37.3KiB          hyper hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_loop
 0.2%   0.5%  36.9KiB regex_automata regex_automata::meta::strategy::new
 0.2%   0.5%  36.5KiB           prek prek::workspace::Workspace::discover
 0.2%   0.4%  30.8KiB           std? <core::marker::PhantomData<T> as serde_core::de::DeserializeSeed>::deserialize
 0.2%   0.4%  30.7KiB           prek prek::cli::run::run::run::{{closure}}
 0.2%   0.4%  29.8KiB           prek prek::languages::rust::installer::RustInstaller::install::{{closure}}
 0.2%   0.4%  28.4KiB           prek prek::languages::node::installer::NodeInstaller::install::{{closure}}
 0.2%   0.4%  27.9KiB             h2 h2::proto::connection::DynConnection<B>::recv_frame
 0.2%   0.3%  27.6KiB           prek prek::identify::by_extension::{{closure}}
 0.2%   0.3%  27.3KiB           prek prek::cli::run::run::run_hooks::{{closure}}
 0.2%   0.3%  26.2KiB           prek prek::cli::auto_update::update_repo::{{closure}}
 0.1%   0.3%  25.3KiB           prek prek::main
 0.1%   0.3%  24.7KiB           prek prek::hook::HookBuilder::build::{{closure}}
41.2%  88.5%   6.9MiB                And 10639 smaller methods. Use -n N to show more.
46.5% 100.0%   7.8MiB                .text section size, the file size is 16.7MiB

#[derive(Debug, Copy, Clone, PartialEq, Eq)]
enum RuntimeKind {
Auto,
Container,
Copy link
Owner

Choose a reason for hiding this comment

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

This name is a bit confusing. Could we call it something like apple-container instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Works for me, I updated this enum to AppleContainer and similar elsewhere. But I did keep the user-facing name as container for PREK_CONTAINER_RUNTIME since it's the name of the executable (and the package name in homebrew/nix) and needing to use something else there would (at least to me) be pretty counterintuitive / surprising

@j178 j178 merged commit d0c33b1 into j178:master Jan 7, 2026
22 checks passed
@j178
Copy link
Owner

j178 commented Jan 7, 2026

Thanks!

@branchv branchv deleted the container branch January 7, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants