Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1516 +/- ##
==========================================
- Coverage 91.79% 91.78% -0.02%
==========================================
Files 98 101 +3
Lines 20119 20565 +446
==========================================
+ Hits 18469 18876 +407
- Misses 1650 1689 +39 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📦 Cargo Bloat ComparisonBinary size change: +0.40% (24.8 MiB → 24.9 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
d8626a9 to
7cc4a12
Compare
7cc4a12 to
d9f55cf
Compare
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. --------- Co-authored-by: Jo <10510431+j178@users.noreply.github.com> Co-authored-by: Janosh Riebesell <janosh.riebesell@gmail.com>
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
⚡️ Hyperfine BenchmarksSummary: 0 regressions, 0 improvements above the 10% threshold. Environment
CLI CommandsBenchmarking basic commands in the main repo:
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base --version |
2.3 ± 0.1 | 2.2 | 2.9 | 1.00 ± 0.06 |
prek-head --version |
2.3 ± 0.1 | 2.2 | 3.0 | 1.00 |
prek list
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base list |
8.9 ± 0.1 | 8.7 | 9.2 | 1.00 |
prek-head list |
8.9 ± 0.1 | 8.7 | 9.4 | 1.00 ± 0.02 |
prek validate-config .pre-commit-config.yaml
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base validate-config .pre-commit-config.yaml |
3.2 ± 0.0 | 3.1 | 3.3 | 1.00 ± 0.02 |
prek-head validate-config .pre-commit-config.yaml |
3.2 ± 0.0 | 3.1 | 3.3 | 1.00 |
prek sample-config
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base sample-config |
2.6 ± 0.0 | 2.5 | 2.7 | 1.00 |
prek-head sample-config |
2.6 ± 0.0 | 2.5 | 2.7 | 1.01 ± 0.02 |
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 |
157.1 ± 2.5 | 152.6 | 160.6 | 1.00 |
prek-head run --all-files |
164.2 ± 10.0 | 155.9 | 188.2 | 1.05 ± 0.07 |
prek run --all-files (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --all-files |
156.6 ± 3.4 | 151.4 | 164.6 | 1.00 |
prek-head run --all-files |
157.3 ± 2.7 | 150.4 | 161.0 | 1.00 ± 0.03 |
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 |
158.3 ± 4.0 | 153.6 | 178.3 | 1.00 |
prek-head run --all-files |
161.5 ± 27.5 | 150.5 | 350.8 | 1.02 ± 0.18 |
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 |
21.8 ± 0.3 | 21.1 | 22.3 | 1.00 ± 0.02 |
prek-head run trailing-whitespace --all-files |
21.8 ± 0.3 | 21.2 | 22.4 | 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 |
29.0 ± 1.8 | 25.7 | 32.6 | 1.00 |
prek-head run end-of-file-fixer --all-files |
29.4 ± 2.2 | 25.7 | 35.6 | 1.01 ± 0.10 |
prek run check-json --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-json --all-files |
12.1 ± 0.2 | 11.8 | 12.6 | 1.00 ± 0.03 |
prek-head run check-json --all-files |
12.1 ± 0.3 | 11.6 | 12.6 | 1.00 |
prek run check-yaml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-yaml --all-files |
11.9 ± 0.2 | 11.6 | 12.5 | 1.01 ± 0.02 |
prek-head run check-yaml --all-files |
11.8 ± 0.1 | 11.6 | 12.2 | 1.00 |
prek run check-toml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-toml --all-files |
12.0 ± 0.2 | 11.6 | 12.6 | 1.00 |
prek-head run check-toml --all-files |
12.1 ± 0.3 | 11.5 | 13.0 | 1.00 ± 0.03 |
prek run check-xml --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-xml --all-files |
12.1 ± 0.4 | 11.5 | 13.1 | 1.01 ± 0.04 |
prek-head run check-xml --all-files |
11.9 ± 0.2 | 11.4 | 12.5 | 1.00 |
prek run detect-private-key --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run detect-private-key --all-files |
19.4 ± 1.6 | 16.8 | 23.3 | 1.05 ± 0.13 |
prek-head run detect-private-key --all-files |
18.4 ± 1.6 | 16.3 | 22.0 | 1.00 |
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 |
23.8 ± 1.5 | 21.2 | 26.5 | 1.00 |
prek-head run fix-byte-order-marker --all-files |
24.2 ± 1.9 | 21.2 | 27.9 | 1.02 ± 0.10 |
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 |
4.7 ± 0.1 | 4.7 | 4.8 | 1.00 ± 0.02 |
prek-head install-hooks |
4.7 ± 0.1 | 4.7 | 4.8 | 1.00 |
prek install-hooks (warm - with cache)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base install-hooks |
4.8 ± 0.0 | 4.7 | 4.8 | 1.00 |
prek-head install-hooks |
4.8 ± 0.0 | 4.8 | 4.9 | 1.01 ± 0.01 |
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 |
52.5 ± 0.8 | 51.4 | 54.7 | 1.00 |
prek-head run |
53.0 ± 1.1 | 51.4 | 54.8 | 1.01 ± 0.03 |
prek run --files '*.json' (specific file type)
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run --files '*.json' |
9.0 ± 0.1 | 8.9 | 9.3 | 1.01 ± 0.02 |
prek-head run --files '*.json' |
8.9 ± 0.1 | 8.7 | 9.1 | 1.00 |
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.0 ± 0.4 | 13.6 | 15.3 | 1.01 ± 0.03 |
prek-head run --dry-run --all-files |
13.8 ± 0.1 | 13.6 | 14.1 | 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 |
12.5 ± 0.1 | 12.4 | 12.9 | 1.00 |
prek-head run check-hooks-apply --all-files |
12.6 ± 0.1 | 12.5 | 12.7 | 1.00 ± 0.01 |
prek run check-useless-excludes --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run check-useless-excludes --all-files |
12.4 ± 0.1 | 12.3 | 12.8 | 1.00 |
prek-head run check-useless-excludes --all-files |
12.5 ± 0.1 | 12.3 | 12.8 | 1.00 ± 0.01 |
prek run identity --all-files
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
prek-base run identity --all-files |
10.8 ± 0.1 | 10.7 | 11.0 | 1.00 |
prek-head run identity --all-files |
10.9 ± 0.1 | 10.8 | 11.0 | 1.01 ± 0.01 |
|
Ahhh thanks for the ping haha. I can take this back up today if you'd like, otherwise if you're taking it over that'd be great as well :) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a9a18d5a87
ℹ️ 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".
There was a problem hiding this comment.
Pull request overview
Adds first-class language: deno support to prek, including toolchain resolution/download, schema + docs updates, and CI + integration tests to exercise Deno hooks.
Changes:
- Register
denoas a supported language across config parsing, schema, CLI docs, and language dispatch. - Implement Deno toolchain install/version resolution plus hook install/run plumbing.
- Add Deno language integration tests and run them in CI via a new nextest profile and
setup-deno.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
prek.schema.json |
Adds deno to schema definitions/enums. |
docs/languages.md |
Documents Deno as supported and describes version formats/usage examples. |
docs/cli.md |
Adds deno to the CLI “language” listing. |
crates/prek/tests/languages/main.rs |
Registers the new Deno test module. |
crates/prek/tests/languages/deno.rs |
Adds integration coverage for Deno execution, caching, versions, etc. |
crates/prek/src/store.rs |
Introduces tool/cache buckets for Deno. |
crates/prek/src/languages/version.rs |
Wires LanguageRequest::Deno into version request parsing/satisfaction checks. |
crates/prek/src/languages/mod.rs |
Adds Deno language implementation to install/health/run dispatch and capability flags. |
crates/prek/src/languages/deno/* |
Implements Deno language runner + installer + version request parsing. |
crates/prek/src/config.rs |
Adds Language::Deno to the enum. |
crates/prek-consts/src/env_vars.rs |
Adds PREK_INTERNAL__DENO_BINARY_NAME and DENO_DIR. |
.github/workflows/ci.yml |
Adds a deno language-test matrix entry and installs Deno in that job. |
.config/nextest.toml |
Adds profile.lang-deno filter for Deno language tests. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds first-class language: deno support to prek (toolchain install + hook execution), wiring it through the language dispatch layer, CI, schema, and docs to close #619.
Changes:
- Introduces a Deno language implementation with toolchain resolution/download +
additional_dependenciesinstallation viadeno install --global. - Wires Deno through language parsing/dispatch, store buckets, env var constants, and CI/nextest profiles.
- Adds end-to-end integration tests and expands docs/schema/CLI references to include
deno.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
prek.schema.json |
Adds deno to the schema’s language/version surfaces. |
docs/languages.md |
Documents Deno language behavior, language_version, and dependency rules. |
docs/cli.md |
Updates CLI language listing to include deno. |
crates/prek/tests/languages/main.rs |
Registers the new deno language test module. |
crates/prek/tests/languages/deno.rs |
Adds integration coverage for Deno execution, deps, remote hooks, and version selection. |
crates/prek/src/store.rs |
Adds ToolBucket::Deno and CacheBucket::Deno for toolchain + caching. |
crates/prek/src/languages/version.rs |
Adds LanguageRequest::Deno to parse/satisfy Deno language_version. |
crates/prek/src/languages/mod.rs |
Plumbs Language::Deno into install/run/health checks and bucket selection. |
crates/prek/src/languages/deno/mod.rs |
Introduces the Deno language module layout and exports. |
crates/prek/src/languages/deno/installer.rs |
Implements system lookup + download/install for requested Deno versions. |
crates/prek/src/languages/deno/deno.rs |
Implements Deno hook env creation, dependency installs, and runtime execution. |
crates/prek/src/languages/deno/version.rs |
Defines Deno version/request parsing and matching. |
crates/prek/src/config.rs |
Adds Language::Deno to the config language enum. |
crates/prek-consts/src/env_vars.rs |
Adds Deno-related env var constants used by installer/runtime. |
.github/workflows/ci.yml |
Installs Deno in CI language matrix and adds DENO_VERSION env. |
.config/nextest.toml |
Adds a nextest profile to run only Deno language tests. |
Closes #619