freshcrate
Home > Frameworks > pre-commit

pre-commit

A framework for managing and maintaining multi-language pre-commit hooks.

Description

[![build status](https://github.com/pre-commit/pre-commit/actions/workflows/main.yml/badge.svg)](https://github.com/pre-commit/pre-commit/actions/workflows/main.yml) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/pre-commit/pre-commit/main.svg)](https://results.pre-commit.ci/latest/github/pre-commit/pre-commit/main) ## pre-commit A framework for managing and maintaining multi-language pre-commit hooks. For more information see: https://pre-commit.com/

Release History

VersionChangesUrgencyDate
v4.6.0### Features - `pre-commit hook-impl`: allow `--hook-dir` to be missing to enable easier usage with `git` 2.54+ git hooks. - #3662 PR by @asottile. ### Fixes - `pre-commit hook-impl`: `--hook-type` is required. - #3661 PR by @asottile. High4/21/2026
4.5.1Imported from PyPI (4.5.1)Low4/21/2026
v4.5.1### Fixes - Fix `language: python` with `repo: local` without `additional_dependencies`. - #3597 PR by @asottile. Low12/16/2025
v4.5.0### Features - Add `pre-commit hazmat`. - #3585 PR by @asottile. Low11/22/2025
v4.4.0### Features - Add `--fail-fast` option to `pre-commit run`. - #3528 PR by @JulianMaurin. - Upgrade `ruby-build` / `rbenv`. - #3566 PR by @asottile. - #3565 issue by @MRigal. - Add `language: unsupported` / `language: unsupported_script` as aliases for `language: system` / `language: script` (which will eventually be deprecated). - #3577 PR by @asottile. - Add support docker-in-docker detection for cgroups v2. - #3535 PR by @br-rhrbacek. - #3360 issue by @JasonALow11/8/2025
v4.3.0### Features - `language: docker` / `language: docker_image`: detect rootless docker. - #3446 PR by @matthewhughes934. - #1243 issue by @dkolepp. - `language: julia`: avoid `startup.jl` when executing hooks. - #3496 PR by @ericphanson. - `language: dart`: support latest dart versions which require a higher sdk lower bound. - #3507 PR by @bc-lee. Low8/9/2025
v4.2.0### Features - For `language: python` first attempt a versioned python executable for the default language version before consulting a potentially unversioned `sys.executable`. - #3430 PR by @asottile. ### Fixes - Handle error during conflict detection when a file is named "HEAD" - #3425 PR by @tusharsadhwani. Low3/18/2025
v4.1.0### Features - Add `language: julia`. - #3348 PR by @fredrikekre. - #2689 issue @jmuchovej. ### Fixes - Disable automatic toolchain switching for `language: golang`. - #3304 PR by @AleksaC. - #3300 issue by @AleksaC. - #3149 issue by @nijel. - Fix `language: r` installation when initiated by RStudio. - #3389 PR by @lorenzwalthert. - #3385 issue by @lorenzwalthert. Low1/20/2025
v4.0.1### Fixes - Fix `pre-commit migrate-config` for unquoted deprecated stages names with purelib `pyyaml`. - #3324 PR by @asottile. - pre-commit-ci/issues#234 issue by @lorenzwalthert. Low10/8/2024
v4.0.0### Features - Improve `pre-commit migrate-config` to handle more yaml formats. - #3301 PR by @asottile. - Handle `stages` deprecation in `pre-commit migrate-config`. - #3302 PR by @asottile. - #2732 issue by @asottile. - Upgrade `ruby-build`. - #3199 PR by @ThisGuyCodes. - Add "sensible regex" warnings to `repo: meta`. - #3311 PR by @asottile. - Add warnings for deprecated `stages` (`commit` -> `pre-commit`, `push` -> `pre-push`, `merge-commit` -> `pre-merge-comLow10/5/2024
v3.8.0### Features - Implement health checks for `language: r` so environments are recreated if the system version of R changes. - #3206 issue by @lorenzwalthert. - #3265 PR by @lorenzwalthert. Low7/28/2024
v3.7.1### Fixes - Fix `language: rust` default language version check when `rust-toolchain.toml` is present. - issue by @gaborbernat. - #3201 PR by @asottile. Low5/11/2024
v3.7.0### Features - Use a tty for `docker` and `docker_image` hooks when `--color` is specified. - #3122 PR by @glehmann. ### Fixes - Fix `fail_fast` for individual hooks stopping when previous hooks had failed. - #3167 issue by @tp832944. - #3168 PR by @asottile. ### Updating - The per-hook behaviour of `fail_fast` was fixed. If you want the pre-3.7.0 behaviour, add `fail_fast: true` to all hooks before the last `fail_fast` hook. Low3/24/2024
v3.6.2### Fixes - Fix building golang hooks during `git commit --all`. - #3130 PR by @asottile. - #2722 issue by @pestanko and @matthewhughes934.Low2/18/2024
v3.6.1### Fixes - Remove `PYTHONEXECUTABLE` from environment when running. - #3110 PR by @untitaker. - Handle staged-files-only with only a crlf diff. - #3126 PR by @asottile. - issue by @tyyrok. Low2/10/2024
v3.6.0### Features - Check `minimum_pre_commit_version` first when parsing configs. - #3092 PR by @asottile. ### Fixes - Fix deprecation warnings for `importlib.resources`. - #3043 PR by @asottile. - Fix deprecation warnings for rmtree. - #3079 PR by @edgarrmondragon. ### Updating - Drop support for python<3.9. - #3042 PR by @asottile. - #3093 PR by @asottile. Low12/9/2023
v3.5.0### Features - Improve performance of `check-hooks-apply` and `check-useless-excludes`. - #2998 PR by @mxr. - #2935 issue by @mxr. ### Fixes - Use `time.monotonic()` for more accurate hook timing. - #3024 PR by @adamchainz. ### Migrating - Require npm 6.x+ for `language: node` hooks. - #2996 PR by @RoelAdriaans. - #1983 issue by @henryiii. Low10/13/2023
v3.4.0### Features - Add `language: haskell`. - #2932 by @alunduil. - Improve cpu count detection when run under cgroups. - #2979 PR by @jdb8. - #2978 issue by @jdb8. ### Fixes - Handle negative exit codes from hooks receiving posix signals. - #2971 PR by @chriskuehl. - #2970 issue by @chriskuehl.Low9/2/2023
v3.3.3### Fixes - Work around OS packagers setting `--install-dir` / `--bin-dir` in gem settings. - #2905 PR by @jaysoffian. - #2799 issue by @lmilbaum. Low6/13/2023
v3.3.2### Fixes - Work around `r` on windows sometimes double-un-quoting arguments. - #2885 PR by @lorenzwalthert. - #2870 issue by @lorenzwalthert. Low5/17/2023
v3.3.1### Fixes - Work around `git` partial clone bug for `autoupdate` on windows. - #2866 PR by @asottile. - #2865 issue by @adehad. Low5/2/2023
v3.3.0### Features - Upgrade ruby-build. - #2846 PR by @jalessio. - Use blobless clone for faster autoupdate. - #2859 PR by @asottile. - Add `-j` / `--jobs` argument to `autoupdate` for parallel execution. - #2863 PR by @asottile. - issue by @gaborbernat. Low5/1/2023
v3.2.2### Fixes - Fix support for swift >= 5.8. - #2836 PR by @edelabar. - #2835 issue by @kgrobelny-intive. Low4/3/2023
v3.2.1### Fixes - Fix `language_version` for `language: rust` without global `rustup`. - #2823 issue by @daschuer. - #2827 PR by @asottile. Low3/25/2023
v3.2.0### Features - Allow `pre-commit`, `pre-push`, and `pre-merge-commit` as `stages`. - #2732 issue by @asottile. - #2808 PR by @asottile. - Add `pre-rebase` hook support. - #2582 issue by @BrutalSimplicity. - #2725 PR by @mgaligniana. ### Fixes - Remove bulky cargo cache from `language: rust` installs. - #2820 PR by @asottile. Low3/17/2023
v3.1.1### Fixes - Fix `rust` with `language_version` and a non-writable host `RUSTUP_HOME`. - pre-commit-ci/issues#173 by @Swiftb0y. - #2788 by @asottile.Low2/28/2023
v3.1.0### Fixes - Fix `dotnet` for `.sln`-based hooks for dotnet>=7.0.200. - #2763 PR by @m-rsha. - Prevent stashing when `diff` fails to execute. - #2774 PR by @asottile. - #2773 issue by @strubbly. - Dependencies are no longer sorted in repository key. - #2776 PR by @asottile. ### Updating - Deprecate `language: python_venv`. Use `language: python` instead. - #2746 PR by @asottile. - #2734 issue by @asottile. Low2/23/2023
v3.0.4### Fixes - Fix hook diff detection for files affected by `--textconv`. - #2743 PR by @adamchainz. - #2743 issue by @adamchainz.Low2/3/2023
v3.0.3### Fixes - Revert "Prevent local `Gemfile` from interfering with hook execution.". - #2739 issue by @Roguelazer. - #2740 PR by @asottile. Low2/1/2023
v3.0.2### Fixes - Prevent local `Gemfile` from interfering with hook execution. - #2727 PR by @asottile. - Fix `language: r`, `repo: local` hooks - pre-commit-ci/issues#107 by @lorenzwalthert. - #2728 PR by @asottile. Low1/30/2023
v3.0.1### Fixes - Ensure coursier hooks are available offline after install. - #2723 PR by @asottile. Low1/26/2023
v3.0.0### Features - Make `language: golang` bootstrap `go` if not present. - #2651 PR by @taoufik07. - #2649 issue by @taoufik07. - `language: coursier` now supports `additional_dependencies` and `repo: local` - #2702 PR by @asottile. - Upgrade `ruby-build` to `20221225`. - #2718 PR by @jalessio. ### Fixes - Improve error message for invalid yaml for `pre-commit autoupdate`. - #2686 PR by @asottile. - #2685 issue by @CarstenGrohmann. - `repo: local` no longer proLow1/24/2023
v2.21.0### Features - Require new-enough virtualenv to prevent 3.10 breakage - #2467 PR by @asottile. - Respect aliases with `SKIP` for environment install. - #2480 PR by @kmARC. - #2478 issue by @kmARC. - Allow `pre-commit run --files` against unmerged paths. - #2484 PR by @asottile. - Also apply regex warnings to `repo: local` hooks. - #2524 PR by @chrisRedwine. - #2521 issue by @asottile. - `rust` is now a "first class" language -- supporting `language_version` andLow12/25/2022
v2.20.0### Features - Expose `source` and `object-name` (positional args) of `prepare-commit-msg` hook as `PRE_COMMIT_COMIT_MSG_SOURCE` and `PRE_COMMIT_COMMIT_OBJECT_NAME`. - #2407 PR by @M-Whitaker. - #2406 issue by @M-Whitaker. ### Fixes - Fix `language: ruby` installs when `--user-install` is set in gemrc. - #2394 PR by @narpfel. - #2393 issue by @narpfel. - Adjust pty setup for solaris. - #2390 PR by @gaige. - #2389 issue by @gaige. - Remove unused `--config` opLow7/11/2022
v2.19.0### Features - Allow multiple outputs from `language: dotnet` hooks. - #2332 PR by @WallucePinkham. - Add more information to `healthy()` failure. - #2348 PR by @asottile. - Upgrade ruby-build. - #2342 PR by @jalessio. - Add `pre-commit validate-config` / `pre-commit validate-manifest` and deprecate `pre-commit-validate-config` and `pre-commit-validate-manifest`. - #2362 PR by @asottile. ### Fixes - Fix `pre-push` when pushed ref contains spaces. - #2345 PR by @wLow5/5/2022
v2.18.1### Fixes - Fix regression for `repo: local` hooks running `python<3.7` - #2324 PR by @asottile. Low4/3/2022
v2.18.0### Features - Keep `GIT_HTTP_PROXY_AUTHMETHOD` in git environ. - #2272 PR by @VincentBerthier. - #2271 issue by @VincentBerthier. - Support both `cs` and `coursier` executables for coursier hooks. - #2293 PR by @Holzhaus. - Include more information in errors for `language_version` / `additional_dependencies` for languages which do not support them. - #2315 PR by @asottile. - Have autoupdate preferentially pick tags which look like versions when there are multiple equivaLow4/2/2022
v2.17.0### Features - add warnings for regexes containing `[\\/]`. - #2151 issue by @sanjioh. - #2154 PR by @kuviokelluja. - upgrade supported ruby versions. - #2205 PR by @jalessio. - allow `language: conda` to use `mamba` or `micromamba` via `PRE_COMMIT_USE_MAMBA=1` or `PRE_COMMIT_USE_MICROMAMBA=1` respectively. - #2204 issue by @janjagusch. - #2207 PR by @xhochy. - display `git --version` in error report. - #2210 PR by @asottile. - add `language: lua` as a supporteLow1/18/2022
v2.16.0### Features - add warning for regexes containing `[\/]` or `[/\\]`. - #2053 PR by @radek-sprta. - #2043 issue by @asottile. - move hook template back to `bash` resolving shebang-portability issues. - #2065 PR by @asottile. - add support for `fail_fast` at the individual hook level. - #2097 PR by @colens3. - #1143 issue by @potiuk. - allow passthrough of `GIT_CONFIG_KEY_*`, `GIT_CONFIG_VALUE_*`, and `GIT_CONFIG_COUNT`. - #2136 PR by @emzeat. ### Fixes - fix Low11/30/2021
v2.15.0### Features - add support for hooks written in `dart`. - #2027 PR by @asottile. - add support for `post-rewrite` hooks. - #2036 PR by @uSpike. - #2035 issue by @uSpike. ### Fixes - fix `check-useless-excludes` with exclude matching broken symlink. - #2029 PR by @asottile. - #2019 issue by @pkoch. - eliminate duplicate mutable sha warning messages for `pre-commit autoupdate`. - #2030 PR by @asottile. - #2010 issue by @graingert. Low9/3/2021
v2.14.1### Fixes - fix force-push of disparate histories using git>=2.28. - #2005 PR by @asottile. - #2002 issue by @bogusfocused. - fix `check-useless-excludes` and `check-hooks-apply` matching non-root `.pre-commit-config.yaml`. - #2026 PR by @asottile. - pre-commit-ci/issues#84 issue by @billsioros. Low8/28/2021
v2.14.0### Features - During `pre-push` hooks, expose local branch as `PRE_COMMIT_LOCAL_BRANCH`. - #1947 PR by @FlorentClarret. - #1410 issue by @MaicoTimmerman. - Improve container id detection for docker-beside-docker with custom hostname. - #1919 PR by @adarnimrod. - #1918 issue by @adarnimrod. ### Fixes - Read legacy hooks in an encoding-agnostic way. - #1943 PR by @asottile. - #1942 issue by @sbienkow-ninja. - Fix execution of docker hooks for docker-in-docker.Low8/6/2021
v2.13.0### Features - Setting `SKIP=...` skips installation as well. - #1875 PR by @asottile. - pre-commit-ci/issues#53 issue by @TylerYep. - Attempt to mount from host with docker-in-docker. - #1888 PR by @okainov. - #1387 issue by @okainov. - Enable `repo: local` for `r` hooks. - #1878 PR by @lorenzwalthert. - Upgrade `ruby-build` and `rbenv`. - #1913 PR by @jalessio. ### Fixes - Better detect `r` packages. - #1898 PR by @lorenzwalthert. - Avoid warnings wiLow5/21/2021
v2.12.1### Fixes - Fix race condition when stashing files in multiple parallel invocations - #1881 PR by @adamchainz. - #1880 issue by @adamchainz.Low4/16/2021
v2.12.0### Features - Upgrade rbenv. - #1854 PR by @asottile. - #1848 issue by @sirosen. ### Fixes - Give command length a little more room when running batch files on windows so underlying commands can expand further. - #1864 PR by @asottile. - pre-commit/mirrors-prettier#7 issue by @DeltaXWizard. - Fix permissions of root folder in ruby archives. - #1868 PR by @asottile.Low4/6/2021
v2.11.1### Fixes - Fix r hooks when hook repo is a package - #1831 PR by @lorenzwalthert. Low3/10/2021
v2.11.0### Features - Improve warning for mutable ref. - #1809 PR by @JamMarHer. - Add support for `post-merge` hook. - #1800 PR by @psacawa. - #1762 issue by @psacawa. - Add `r` as a supported hook language. - #1799 PR by @lorenzwalthert. ### Fixes - Fix `pre-commit install` on `subst` / network drives on windows. - #1814 PR by @asottile. - #1802 issue by @goroderickgo. - Fix installation of `local` golang repositories for go 1.16. - #1818 PR by @rafikdraoui.Low3/7/2021
v2.10.1### Fixes - Fix `language: golang` repositories containing recursive submodules - #1788 issue by @gaurav517. - #1789 PR by @paulhfischer.Low2/6/2021
v2.10.0### Features - Allow `ci` as a top-level map for configuration for https://pre-commit.ci - #1735 PR by @asottile. - Add warning for mutable `rev` in configuration - #1715 PR by @paulhfischer. - #974 issue by @asottile. - Add warning for `/*` in top-level `files` / `exclude` regexes - #1750 PR by @paulhfischer. - #1702 issue by @asottile. - Expose `PRE_COMMIT_REMOTE_BRANCH` environment variable during `pre-push` hooks - #1770 PR by @surafelabebe. - Produce errorLow1/27/2021
v2.9.3### Fixes - Fix crash on cygwin mismatch check outside of a git directory - #1721 PR by @asottile. - #1720 issue by @chronoB. - Fix cleanup code on docker volumes for go - #1725 PR by @fsouza. - Fix working directory detection on SUBST drives on windows - #1727 PR by @mrogaski. - #1610 issue by @jcameron73. Low12/7/2020
v2.9.2### Fixes - Fix default value for `types_or` so `symlink` and `directory` can be matched - #1716 PR by @asottile. - #1718 issue by @CodeBleu. Low11/26/2020

Dependencies & License Audit

Loading dependencies...

Similar Packages

azure-core-tracing-opentelemetryMicrosoft Azure Azure Core OpenTelemetry plugin Library for Pythonazure-template_0.1.0b6187637
spdx-toolsSPDX parser and tools.0.8.5
lacesDjango components that know how to render themselves.0.1.2
django-tasksA backport of Django's built in Tasks framework0.12.0
dagster-awsPackage for AWS-specific Dagster framework solid and resource components.0.29.1