Skip to content

Conversation

@shaanmajid
Copy link
Contributor

@shaanmajid shaanmajid commented Feb 1, 2026

Closes #619

@codecov
Copy link

codecov bot commented Feb 1, 2026

Codecov Report

❌ Patch coverage is 89.34426% with 52 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.90%. Comparing base (4525825) to head (ca36577).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
crates/prek/src/languages/deno/installer.rs 85.63% 26 Missing ⚠️
crates/prek/src/languages/deno/deno.rs 89.94% 18 Missing ⚠️
crates/prek/src/languages/deno/version.rs 95.76% 5 Missing ⚠️
crates/prek/src/languages/mod.rs 50.00% 2 Missing ⚠️
crates/prek/src/languages/version.rs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1516      +/-   ##
==========================================
- Coverage   91.98%   91.90%   -0.08%     
==========================================
  Files          88       91       +3     
  Lines       18374    18878     +504     
==========================================
+ Hits        16901    17350     +449     
- Misses       1473     1528      +55     

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

@prek-ci-bot
Copy link

prek-ci-bot bot commented Feb 1, 2026

📦 Cargo Bloat Comparison

Binary size change: +0.89% (22.5 MiB → 22.7 MiB)

Expand for cargo-bloat output

Head Branch Results

 File  .text    Size           Crate Name
 0.3%   0.8% 75.3KiB           prek? <prek::cli::Command as clap_builder::derive::Subcommand>::augment_subcommands
 0.3%   0.8% 70.7KiB            prek prek::languages::<impl prek::config::Language>::run::{{closure}}::{{closure}}
 0.3%   0.7% 66.3KiB            prek prek::languages::<impl prek::config::Language>::run::{{closure}}::{{closure}}
 0.2%   0.6% 54.4KiB            prek prek::languages::<impl prek::config::Language>::install::{{closure}}
 0.2%   0.5% 43.4KiB            prek prek::identify::by_extension::{{closure}}
 0.2%   0.5% 43.1KiB            prek prek::run::{{closure}}
 0.2%   0.4% 41.5KiB            prek prek::cli::run::run::run::{{closure}}
 0.1%   0.3% 31.8KiB           prek? <prek::cli::RunArgs as clap_builder::derive::Args>::augment_args
 0.1%   0.2% 22.1KiB            prek prek::hooks::meta_hooks::MetaHooks::run::{{closure}}
 0.1%   0.2% 21.9KiB            prek prek::hooks::meta_hooks::MetaHooks::run::{{closure}}
 0.1%   0.2% 21.9KiB             std core::ptr::drop_in_place<prek::languages::<impl prek::config::Language>::install::{{closure}}>
 0.1%   0.2% 21.2KiB    clap_builder clap_builder::parser::parser::Parser::get_matches_with
 0.1%   0.2% 20.9KiB            prek prek::archive::unzip::{{closure}}
 0.1%   0.2% 19.5KiB            prek prek::cli::run::filter::collect_files_from_args::{{closure}}
 0.1%   0.2% 19.3KiB            prek <prek::languages::ruby::ruby::Ruby as prek::languages::LanguageImpl>::install::{{closure}}
 0.1%   0.2% 19.1KiB            prek prek::cli::run::filter::collect_files_from_args::{{closure}}
 0.1%   0.2% 18.6KiB            ring ring_core_0_17_14__x25519_ge_frombytes_vartime
 0.1%   0.2% 18.2KiB           prek? <prek::cli::GlobalArgs as clap_builder::derive::Args>::augment_args
 0.1%   0.2% 18.1KiB cargo_metadata? <cargo_metadata::_::<impl serde_core::de::Deserialize for cargo_metadata::Package>::deserialize::__Visitor as serde_core::de::Visitor>::visit_map
 0.1%   0.2% 18.1KiB       [Unknown] fe_loose_invert
36.9%  91.3%  8.4MiB                 And 20082 smaller methods. Use -n N to show more.
40.4% 100.0%  9.2MiB                 .text section size, the file size is 22.7MiB

Base Branch Results

 File  .text    Size           Crate Name
 0.3%   0.8% 71.2KiB           prek? <prek::cli::Command as clap_builder::derive::Subcommand>::augment_subcommands
 0.3%   0.7% 63.4KiB            prek prek::languages::<impl prek::config::Language>::run::{{closure}}::{{closure}}
 0.3%   0.6% 58.7KiB            prek prek::languages::<impl prek::config::Language>::run::{{closure}}::{{closure}}
 0.2%   0.5% 46.0KiB            prek prek::languages::<impl prek::config::Language>::install::{{closure}}
 0.2%   0.5% 43.2KiB            prek prek::run::{{closure}}
 0.2%   0.5% 43.1KiB            prek prek::identify::by_extension::{{closure}}
 0.2%   0.4% 41.5KiB            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% 22.1KiB            prek prek::hooks::meta_hooks::MetaHooks::run::{{closure}}
 0.1%   0.2% 22.1KiB            prek prek::hooks::meta_hooks::MetaHooks::run::{{closure}}
 0.1%   0.2% 21.2KiB    clap_builder clap_builder::parser::parser::Parser::get_matches_with
 0.1%   0.2% 20.6KiB            prek prek::archive::unzip::{{closure}}
 0.1%   0.2% 20.0KiB cargo_metadata? <cargo_metadata::_::<impl serde_core::de::Deserialize for cargo_metadata::Package>::deserialize::__Visitor as serde_core::de::Visitor>::visit_map
 0.1%   0.2% 19.5KiB            prek prek::cli::run::filter::collect_files_from_args::{{closure}}
 0.1%   0.2% 19.3KiB            prek <prek::languages::ruby::ruby::Ruby as prek::languages::LanguageImpl>::install::{{closure}}
 0.1%   0.2% 19.1KiB            prek prek::cli::run::filter::collect_files_from_args::{{closure}}
 0.1%   0.2% 19.0KiB             std core::ptr::drop_in_place<prek::languages::<impl prek::config::Language>::install::{{closure}}>
 0.1%   0.2% 18.6KiB            ring ring_core_0_17_14__x25519_ge_frombytes_vartime
 0.1%   0.2% 18.1KiB       [Unknown] fe_loose_invert
 0.1%   0.2% 18.1KiB      hyper_util hyper_util::client::legacy::client::Client<C,B>::send_request::{{closure}}
36.8%  91.5%  8.3MiB                 And 20057 smaller methods. Use -n N to show more.
40.2% 100.0%  9.1MiB                 .text section size, the file size is 22.5MiB

}

/// List all versions of Deno available on GitHub releases.
async fn list_remote_versions(&self) -> Result<Vec<DenoVersion>> {
Copy link
Owner

Choose a reason for hiding this comment

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

It’s better to fetch the remote versions from https://deno.com/versions.json. It’s lightweight and doesn’t have rate‑limit issues.

Add first-class support for Deno as a hook language, enabling pre-commit
hooks to run Deno scripts, built-in commands (fmt, lint, check), and
npm/jsr packages.

Features:
- Automatic Deno version management with downloads from GitHub releases
- Support for language_version specs: major, minor, patch, semver ranges
- Isolated DENO_DIR cache per hook environment
- Built-in command detection (fmt, lint, test, etc.) without "deno run"
- Script file execution with automatic "deno run" prefix
- npm/jsr package support via additional_dependencies
- Copies deno.json and deno.lock from repos for reproducible builds

The implementation follows the patterns established by Bun and other
managed language runtimes in the codebase.
Add comprehensive test coverage and CI integration for Deno support:

Tests (10 integration tests):
- Basic inline eval execution
- TypeScript script file execution
- Built-in commands (fmt, lint)
- Explicit deno prefix handling
- npm package dependencies
- language_version specifications
- Auto-download without system deno
- Semver range versions
- Hook failure propagation
- Permission flags

CI:
- Add Deno to language test matrix
- Run on Linux only (downloads deno internally)

Documentation:
- Update languages.md with Deno usage examples
- Regenerate CLI reference
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.

Add language: deno and language: bun support

2 participants