j178/prek
71.1
Strong · 14 November 2026
53.5k
lines of production code
Rust
primary language
5
measurements over time
What this system is
Features
Add Deno language support for pre-commit hooks
Users can now configure hooks with \language: deno\. The system automatically manages the Deno toolchain by downloading and caching specific versions (supporting exact, major/minor, and semver-range requests) from the official Deno versions endpoint. It installs additional dependencies as global executables within the hook's isolated environment, allowing hook authors to specify entry points and dependencies using standard Deno install syntax.
crates/prek/src/languages/deno · high confidence
Add Go language backend support
Users can now run pre-commit hooks written in Go. The tool automatically extracts the required Go version from the \go\ or \toolchain\ directives in \go.mod\, installs the matching Go toolchain if needed, and manages dependencies via \go install\. It also sets \GOTOOLCHAIN=local\ to ensure consistent behavior during installation and execution.
crates/prek/src/languages/golang · high confidence
Add Ruby language backend with automatic toolchain installation
Introduces a new Ruby language backend that automatically downloads and manages Ruby interpreters using the \rv\ toolchain manager. The backend installs gems into an isolated environment, builds local gemspecs, and ensures the resolved Ruby binary is correctly placed on the PATH for hook execution. It supports flexible version requests (exact, major.minor, major, or semver ranges) and includes health checks to verify the installed Ruby version matches the hook configuration.
crates/prek/src/languages/ruby · high confidence
Add support for .NET hooks
Users can now define hooks with \language: dotnet\ in their configuration. The system automatically manages the .NET SDK installation (supporting managed downloads, system discovery, and specific version/channel requests like \8.0\ or \lts\), and installs additional dotnet tools specified as dependencies into an isolated environment for each hook.
crates/prek/src/languages/dotnet · high confidence
Add support for the Bun JavaScript runtime
Users can now configure pre-commit hooks to use the Bun runtime by specifying \language: bun\ in their configuration. The system automatically manages the Bun toolchain by resolving versions via Git tags, downloading the appropriate binary if necessary, and installing hook dependencies into an isolated environment. This enables hooks written for or compatible with Bun to run seamlessly alongside existing Node.js and Python support.
crates/prek/src/languages/bun · high confidence
Add support for the mise toolchain manager
Users can now use hooks that require the mise toolchain manager. The system installs and manages the mise binary, isolates its configuration and cache directories to prevent interference with user state, and activates additional tools specified in hook dependencies via the mise CLI.
crates/prek/src/languages/mise · high confidence
Added PGO training and verification scripts for release builds
New scripts in the \scripts/pgo\ directory now enable Profile-Guided Optimization (PGO) for native release binaries on Linux, Windows, and macOS (ARM64). The \train.py\ script builds an instrumented binary, runs a deterministic set of workloads to generate profiling data, and merges the profiles for the final optimized build. Additionally, a \--verify\ mode allows users to smoke-test existing release binaries to ensure they are not PGO-instrumented and function correctly.
scripts/pgo · high confidence
Initial implementation of the file identification engine
This change introduces the \prek-identify\ crate, which provides the core logic for detecting file types and applying tags to files. It includes a bitset-based \TagSet\ structure for efficient tag storage and operations, along with an auto-generated list of 324 supported file tags (such as \javascript\, \python\, \dockerfile\, etc.) used to classify files during the pre-commit hook execution process.
crates/prek-identify/src · high confidence
Introduce Rust language backend with configurable toolchain management
Adds a new Rust language backend that manages Rust toolchains via rustup. Users can now define Rust hooks with version constraints (e.g., \stable\, \1.70\, or semver ranges) and the system will automatically install or locate the required toolchain. The backend supports configurable installation profiles (minimal, default, complete) via the \PREK\_RUST\_PROFILE\ environment variable, prefers stable toolchains by default, and can use \cargo-binstall\ for faster CLI dependency installation when enabled. It also supports installing Rust CLI dependencies from git repositories with optional tag and package disambiguation.
crates/prek/src/languages/rust · high confidence
Introduce \`prek cache clean\`, \`prek cache gc\`, and \`prek cache size\` commands
Users can now manage the prek cache with three new subcommands. \prek cache clean\ removes the entire cache directory and reports the number of files and directories removed along with the total byte count. \prek cache gc\ performs a targeted garbage collection by analyzing tracked configuration files to identify and remove unused repositories, hook environments, tools, cache entries, and stale patch files, providing a detailed summary of what was cleaned. \prek cache size\ displays the total size of the cache, with output that is human-readable by default when connected to a terminal but can be forced to machine-readable format.
crates/prek/src/cli · high confidence
Introduce pygrep language backend for regex-based hooks
Users can now define hooks that use the \pygrep\ language, allowing regex pattern matching against file contents via a dedicated Python-based backend. This new backend handles its own Python environment management (finding or installing a Python interpreter) and executes a custom script to support flags like case-insensitivity, multiline matching, and negation, providing more accurate regex behavior than a generic shell grep.
crates/prek/src/languages/pygrep · high confidence
New \`prek run\` execution engine with parallel hook management and progress UI
The \prek run\ command now uses a completely rewritten execution engine that introduces parallel hook installation and execution, a live terminal progress UI with output previews, and robust worktree management. Users benefit from faster runs via concurrent processing, better visibility into hook output through a streaming progress interface, and improved reliability with automatic stashing and restoration of unstaged changes and intent-to-add files. The new engine also supports advanced filtering by file tags, glob patterns, and hook groups, along with configurable status hiding and priority-based execution.
crates/prek/src/cli/run · high confidence
New build and CI automation scripts for prek
Added \scripts/build-npm-packages.py\ to automate the creation of platform-specific npm packages for prek, supporting macOS (arm64/x64), Linux (arm64/x64 with glibc/musl), Windows (arm64/x64), and Android (arm64). Also added \scripts/generate-ci-matrix.py\ to dynamically generate GitHub Actions matrices for language integration tests, balancing execution time across platforms and groups.
prek · high confidence
New language backends for Conda, Coursier, Dart, Docker, Haskell, Julia, Lua, Perl, and PHP
The \prek\ hook runner now supports a suite of new language backends, allowing hooks written in or requiring environments for Conda (with Pixi, Micromamba, Mamba, or Conda installers), Coursier, Dart, Docker, Docker Image, Haskell, Julia, Lua, Perl, and PHP to be installed and executed. Each backend provisions the necessary dependencies and execution environment specific to its language ecosystem, such as using \pub get\ for Dart, \cabal install\ for Haskell, \Pkg.instantiate()\ for Julia, \luarocks\ for Lua, \cpan\ for Perl, and \composer\ for PHP, while Docker-based hooks run directly in containers.
crates/prek/src/languages · high confidence
Python hook support via uv and PEP 723
The Python language backend now uses \uv\ to manage hook environments, automatically installing it from the Astral CDN with platform-specific wheel selection and checksum verification. It supports PEP 723 inline metadata in Python scripts for dependencies and version requirements, and reads \requires-python\ from a hook repository's \pyproject.toml\ when no explicit version is configured. The backend includes a cached Python interpreter query system and validates the \uv\ binary version after installation.
crates/prek/src/languages/python · high confidence
Support running prek via \`python -m prek\`
Users can now execute the prek tool directly as a Python module using \python -m prek\. This change adds the \prek/\_\main\\_.py\ entry point, which locates the underlying prek binary (handling various installation paths like site-packages or user schemes) and executes it, ensuring consistent behavior across Windows and Unix platforms.
python · high confidence
Removals
Removal of stub pre-commit compatibility CLI
The \src/main.rs\ file, which contained a stub implementation of a \pre-commit\ compatibility namespace (including commands like \install\, \run\, \uninstall\, and \validate-config\), has been deleted. This removes the placeholder CLI interface that previously only printed debug information or returned 'not implemented' errors, indicating that the project is moving away from this specific compatibility layer or restructuring its entry points.
src · high confidence
Behavioural changes
1 commit (0 fixes) modifying crates/prek-ignore, crates/prek-update
A change to existing behaviour in crates/prek-ignore, crates/prek-update — 1 commit, 4 files: “Bump MSRV to Rust 1.98 and adopt new APIs (\#3025)” (refs \#3025). Also in this area: Internal directory walker for workspace discovery.
crates/prek-ignore · medium confidence · unverified
1 commit (0 fixes) modifying crates/prek-ignore, crates/prek-update
A change to existing behaviour in crates/prek-ignore, crates/prek-update — 1 commit, 4 files: “Bump MSRV to Rust 1.98 and adopt new APIs (\#3025)” (refs \#3025). Also in this area: Standalone self-update support for prek.
crates/prek-update · medium confidence · unverified
14 commits (0 fixes) modifying scripts
A change to existing behaviour in scripts — 14 commits, 13 files: “Optimize \detect\_private\_key\ by chunked reading and using aho-corasick”; “Consolidate release automation scripts”; “Respect hook filters for message files (\#2049)”; and 11 more (refs \#2049, \#1773, \#2020, \#2992, \#2983, …).
scripts · medium confidence · unverified
Auto-generated file identification tags from Python identify package
The \prek-identify\ crate now generates its Rust source code (\src/tags.rs\) from the Python \identify\ library via a new \gen.py\ script. This ensures that file extension, name, and interpreter mappings used for hook filtering are kept in sync with upstream \identify\ (currently locked to version 2.6.20). The generation process also applies local overrides for specific extensions like \.cts\, \.mts\, and \.jsonc\ to ensure they are correctly identified as TypeScript or JSONC files, addressing cases where upstream mappings were rejected or missing.
crates/prek-identify · high confidence
Build script now embeds git commit metadata into the binary
The \prek\ crate now includes a build script that captures git commit hash, short hash, date, and last tag information at compile time. This data is exposed to the application via environment variables (e.g., \PREK\_COMMIT\_HASH\), allowing the tool to display accurate version and commit details in its output. The script also handles worktree scenarios and ensures the build reruns when git HEAD changes.
crates/prek · high confidence
Configuration system refactored into focused modules
The configuration parsing logic in \crates/prek/src/config\ has been split into focused modules (\hook\, \pattern\, \priority\, \repo\, \update\) to improve code organization. This change introduces new types for hook stages and languages, adds support for hiding hook status reports via the \hide\_status\ configuration option, and implements validation to warn users about unused keys in their settings.
crates/prek/src/config · high confidence
Introduce \`prek update\` with frozen revisions, tag filters, and freeze mode
The \auto-update\ command has been renamed to \update\ and significantly expanded. Users can now pin specific revisions using \\# frozen:\ comments in their configuration files, which are preserved and updated during the update process. A new \freeze\ option allows forcing revisions to be stored as frozen commit hashes. Tag filtering is now supported via \tag\_filters\ in the configuration and CLI, enabling users to restrict which tags are considered for updates. The update process also includes improved handling of Git repository state isolation, warnings for missing update repositories, and strict UTF-8 decoding for command output to ensure reliability.
crates/prek/src/cli/update · high confidence
Introduce \`shell\` hook option and \`{hook\_repo}\` placeholder
Hooks can now explicitly opt into shell-source execution via a new \shell\ configuration option, allowing entries to be interpreted as shell scripts rather than command paths. Additionally, the \{hook\_repo}\ placeholder is now supported in hook \entry\ fields, automatically expanding to the repository path during execution.
crates/prek/src · high confidence
Introduce centralized environment variable and configuration constant definitions
The \prek-consts\ crate now provides a unified source for all environment variable names and configuration file constants used by the tool. This includes a comprehensive list of \PREK\\\ variables (such as \PREK\_HOME\, \PREK\_SKIP\, \PREK\_CONCURRENT\_HOOKS\, and \PREK\_CONTAINER\_RUNTIME\), language-specific variables for Python, Node, Rust, Go, and others, as well as standard Git and CI environment variables. It also defines the supported configuration file names (\.pre-commit-config.yaml\, \.pre-commit-config.yml\, and \prek.toml\) and provides a helper function to prepend paths to the system \PATH\. This centralization ensures consistent environment variable handling across the codebase.
crates/prek-consts · high confidence
Introduces native Rust implementations for meta and fast-path hooks
The hook execution engine now includes built-in Rust implementations for meta hooks (check-hooks-apply, check-useless-excludes, identity) and specific pre-commit hooks via a 'fast path'. This change allows these hooks to run directly within the tool without spawning external processes, improving performance and reliability. The meta hooks operate at the workspace root to validate configuration files, while the fast-path mechanism bypasses the standard hook dispatch for supported remote hooks, reducing overhead and simplifying the execution flow. Also in this area: 5 commits (0 fixes) modifying crates/prek.
crates/prek/src/hooks · medium confidence · unverified
Node.js hook environment isolation and version management
The Node.js language backend now manages its own Node and npm toolchains, installing them into a dedicated store directory and ensuring they are available on the PATH during hook execution. To prevent interference from the user's global npm configuration, the execution environment explicitly clears npm prefix and cache environment variables (such as NPM\_CONFIG\_PREFIX and npm\_config\_cache) and sets isolated paths for the hook's local dependencies. Additionally, Node version queries are cached to improve performance, and the system supports flexible version requests including LTS codenames and semver ranges.
crates/prek/src/languages/node · high confidence
Support for Android and musl-based Linux platforms via dedicated platform packages
The npm launcher now supports Android and Linux distributions using the musl libc (such as Alpine) by dynamically selecting and executing platform-specific binaries. The tool detects the operating system, architecture, and libc variant at runtime, then resolves and runs the corresponding binary from a dedicated platform package, ensuring compatibility across a wider range of environments.
npm · high confidence
Test coverage
Added integration tests for language hook support; Added integration tests for the \prek run\ command; Comprehensive integration tests for prek core commands and hooks; New integration test infrastructure for Prek.
Dependencies
Project renamed to prek and restructured as a Rust workspace
The project has been renamed from pre-commit-rs to prek and reorganized into a multi-crate workspace (crates/prek, prek-consts, prek-identify, prek-pty). The package version is now 0.5.4, and the project has upgraded to the Rust 2024 edition with a Minimum Supported Rust Version (MSRV) of 1.96. This change also introduces a comprehensive set of dependency updates, including major version bumps for libraries such as anstream (0.6→1.0), serde-saphyr (0.0→1.2), and tokio-tar (0.6→0.7), alongside the adoption of astral-tokio-tar and astral\_async\_zip.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 73 → 71 (-1.7)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 76 → 73 (-3.6)
- Architecture 92 → 93 (+0.7)
- Maturity 75 → 75 (-0.5)
- Readiness 65 → 64 (-1.4)
- Security 85 → 82 (-3.6)
- Domain Modelling 100 → 100 (+0.0)
- Performance 89 → 89 (+0.0)
Resolved (40)
- Duplicated block (10 lines × 2) (crates/prek/src/languages/bun/installer.rs)
- Duplicated block (10 lines × 2) (crates/prek/src/languages/bun/version.rs)
- Duplicated block (10 lines × 3) (crates/prek/src/hooks/pre_commit_hooks/fix_byte_order_marker.rs)
- Duplicated block (10 lines × 4) (crates/prek/src/hooks/pre_commit_hooks/check_json.rs)
- Duplicated block (10–14 lines × 2) (crates/prek/src/hooks/meta_hooks.rs)
- Duplicated block (12 lines × 2) (crates/prek/src/languages/bun/installer.rs)
- Duplicated block (15–16 lines × 2) (crates/prek/src/cli/cache_gc.rs)
- Duplicated block (16 lines × 2) (crates/prek/src/config/hook.rs)
- Duplicated block (5 lines × 2) (crates/prek/src/hooks/pre_commit_hooks/check_executables_have_shebangs.rs)
- Duplicated block (6 lines × 2) (crates/prek/src/languages/bun/bun.rs)
- Duplicated block (6 lines × 2) (crates/prek/src/languages/mod.rs)
- Duplicated block (6–8 lines × 2) (crates/prek/src/languages/docker.rs)
- Duplicated block (7 lines × 2) (crates/prek/src/hooks/pre_commit_hooks/check_json.rs)
- Duplicated block (7 lines × 4) (crates/prek/src/languages/bun/installer.rs)
- Duplicated block (9 lines × 2) (crates/prek/src/languages/golang/installer.rs)
- High: security finding (details withheld)
- HookRunSession::render_hook_details (cognitive 20) (crates/prek/src/cli/run/run.rs)
- HookRunSession::render_hook_details (cyclomatic 17) (crates/prek/src/cli/run/run.rs)
- HookRunSession::render_priority_group (cognitive 23) (crates/prek/src/cli/run/run.rs)
- Hotspot: crates/prek/src/hooks/builtin_hooks/mod.rs (crates/prek/src/hooks/builtin_hooks/mod.rs)
- …and 20 more
New (181)
- Duplicated block (10 lines × 2) (crates/prek/src/languages/bun/version.rs)
- Duplicated block (10 lines × 3) (crates/prek/src/hooks/fix_byte_order_marker.rs)
- Duplicated block (10 lines × 4) (crates/prek/src/hooks/check_json.rs)
- Duplicated block (10–14 lines × 2) (crates/prek/src/hooks/meta.rs)
- Duplicated block (15–16 lines × 2) (crates/prek/src/cli/cache_gc.rs)
- Duplicated block (16 lines × 2) (crates/prek/src/config/hook.rs)
- Duplicated block (5 lines × 2) (crates/prek/src/hooks/check_executables_have_shebangs.rs)
- Duplicated block (6 lines × 2) (crates/prek/src/languages/mod.rs)
- Duplicated block (6–8 lines × 2) (crates/prek/src/languages/docker.rs)
- Duplicated block (7 lines × 2) (crates/prek/src/hooks/check_json.rs)
- Duplicated block (7 lines × 4) (crates/prek/src/languages/bun/installer.rs)
- Duplicated block (9 lines × 2) (crates/prek/src/languages/bun/installer.rs)
- Duplicated block (9 lines × 4) (crates/prek/src/hooks/builtin.rs)
- Edited copies of one member (3 members, 13+ corresponding lines) (crates/prek/src/hooks/check_jsonc.rs)
- Edited copies of one member (3 members, 4+ corresponding lines) (crates/prek/src/languages/bun/version.rs)
- Edited copies of one member (4 members, 20+ corresponding lines) (crates/prek/src/languages/bun/version.rs)
- Edited copies of one member (4 members, 20+ corresponding lines) (crates/prek/src/schema.rs)
- Edited copies of one member (4 members, 34+ corresponding lines) (crates/prek/src/languages/bun/installer.rs)
- Edited copies of one member (4 members, 8+ corresponding lines) (crates/prek/src/languages/dart.rs)
- Edited copies of one member (5 members, 23+ corresponding lines) (crates/prek/src/languages/bun/installer.rs)
- …and 161 more
Changes since last survey
- 52 commits — 52 feature/other, 0 fixes
By area
- crates/prek — 25 commits
- (root) — 16 commits
- .github/workflows — 7 commits
- .github/renovate.json5 — 1 commit
- crates/prek-identify — 1 commit
- docs/installation.md — 1 commit
- docs/proposals — 1 commit
Notable commits
- change: Add normalize-indentation builtin hook (#2967)
- change: Add a builtin replace-pattern hook (#2981)
- change: Add equivalent prek.toml examples throughout the documentation (#2979)
- change: Allow custom commands to launch prek from Git hooks (#3002)
- change: Automatically group read-only hooks (#3020)
- change: Avoid downloading Node prereleases by default (#2995)
- change: Avoid duplicate hook environment checks (#3009)
- change: Bump MSRV to Rust 1.98 and adopt new APIs (#3025)
- change: Bump Rust toolchain to 1.100.0 (#3026)
- change: Bump dependencies (#2977)
- change: Bump version to 0.5.10 (#3001)
- change: Bump version to 0.5.8 (#2978)
- change: Bump version to 0.5.9
- change: Bundle the py.typed marker in wheels (#3011)
- change: Cache file contents across read-only builtin hooks (#3021)
- change: Detect available glibc and musl runtimes (#2975)
- change: Embed dependency metadata in release binaries (#2976)
- change: Enforce store locking with StoreGuard (#3019)
- change: Group CI tools and compatible Rust dependencies (#2991)
- change: Infer hook effects to skip unnecessary Git diffs (#3014)
- …and 32 more
Architecture
- Unchanged — 0 containers · 1 contexts · 0 edges
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
j178/prek was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 14 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit e5e32d74f2378a78e1fe4fc2b7aab47f9d2af804 — the exact code this score is about.
- Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-e1a3b69fc8ee.