unstale

pypi / pre-commit

pre-commit

What changed in pre-commit 3 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

11 breaking1 deprecations5 new APIs and options1 performance4 behavior and defaults12 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

pre-commit 421 changes

Breaking changes 2

  • Requires the --hook-type option.

    4.6.0release notes

  • language: python_venv has been removed; use language: python instead.

    4.0.0release notes

Deprecations 1

  • Deprecated stage values now produce warnings; use pre-commit, pre-push, and pre-merge-commit instead of commit, push, and merge-commit.

    4.0.0release notes

New APIs and options 3

  • Adds the pre-commit hazmat command.

    4.5.0release notes

  • Adds unsupported and unsupported_script as aliases for system and script; the existing values will eventually be deprecated.

    4.4.0release notes

  • Adds --fail-fast to stop running hooks after the first failure.

    4.4.0release notes

Performance 1

  • Improve the performance of the commit existence check in pre-push.

    4.6.1release notes

Behavior and default changes 3

  • Allows --hook-dir to be omitted for easier usage with git 2.54+ hooks.

    4.6.0release notes

  • The command handles more YAML formats, so it can migrate a broader range of configuration files.

    4.0.0release notes

  • repo: meta now emits sensible regex warnings.

    4.0.0release notes

Fixes and other changes 11

  • Fixes language: node hooks during commits with -a or inside a submodule.

    4.7.0release notes

  • Fixes node-language hooks containing a build script when used with npm 11.x.

    4.6.2release notes

  • Set JULIA_DEPOT_PATH for language: julia hooks.

    4.6.1release notes

  • Install hooks configured with language: node via git to fix npm 12.x compatibility.

    4.6.1release notes

  • Mistyped --repo values now produce an error when running pre-commit autoupdate.

    4.6.1release notes

  • Avoid duplicating conflicted filenames when running all files.

    4.6.1release notes

  • Fixes local hooks configured with language: python so they work without additional_dependencies.

    4.5.1release notes

  • Adds support for detecting docker-in-docker when using cgroups v2.

    4.4.0release notes

  • Handles Docker returning SecurityOptions: null.

    4.4.0release notes

  • Improves the error context reported for invalid stages.

    4.4.0release notes

  • The command handles deprecated stages values during migration.

    4.0.0release notes

pre-commit 313 changes

Breaking changes 9

  • Hooks using language: golang must use go.mod to specify dependencies.

    3.0.0release notes

  • The pre-commit-validate-config command is removed; use pre-commit validate-config instead.

    3.0.0release notes

  • Use pre-commit validate-config instead of the removed pre-commit-validate-config command.

    3.0.0release notes

  • The pre-commit-validate-manifest command is removed; use pre-commit validate-manifest instead.

    3.0.0release notes

  • Use pre-commit validate-manifest instead of the removed pre-commit-validate-manifest command.

    3.0.0release notes

  • Support for Python versions below 3.8 is dropped.

    3.0.0release notes

  • repo: local no longer provisions an empty git repository.

    3.0.0release notes

  • sha can no longer be used to specify a revision; use pre-commit migrate-config to update.

    3.0.0release notes

  • Top-level list configuration is no longer supported; use pre-commit migrate-config to update.

    3.0.0release notes

New APIs and options 2

  • language: coursier now supports additional_dependencies.

    3.0.0release notes

  • language: coursier now supports repo: local.

    3.0.0release notes

Behavior and default changes 1

  • A hook configured with language: golang bootstraps go if it is not present.

    3.0.0release notes

Fixes and other changes 1

  • The error message for invalid YAML is improved.

    3.0.0release notes