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 initpre-commit 421 changes
Breaking changes 2
Requires the --hook-type option.
language: python_venvhas been removed; uselanguage: pythoninstead.
Deprecations 1
Deprecated stage values now produce warnings; use
pre-commit,pre-push, andpre-merge-commitinstead ofcommit,push, andmerge-commit.
New APIs and options 3
Adds the pre-commit hazmat command.
Adds
unsupportedandunsupported_scriptas aliases forsystemandscript; the existing values will eventually be deprecated.Adds --fail-fast to stop running hooks after the first failure.
Performance 1
Improve the performance of the commit existence check in pre-push.
Behavior and default changes 3
Allows --hook-dir to be omitted for easier usage with git 2.54+ hooks.
The command handles more YAML formats, so it can migrate a broader range of configuration files.
repo: metanow emits sensible regex warnings.
Fixes and other changes 11
Fixes
language: nodehooks during commits with-aor inside a submodule.Fixes node-language hooks containing a build script when used with npm 11.x.
Set JULIA_DEPOT_PATH for language: julia hooks.
Install hooks configured with language: node via git to fix npm 12.x compatibility.
Mistyped --repo values now produce an error when running pre-commit autoupdate.
Avoid duplicating conflicted filenames when running all files.
Fixes local hooks configured with language: python so they work without additional_dependencies.
Adds support for detecting docker-in-docker when using cgroups v2.
Handles Docker returning
SecurityOptions: null.Improves the error context reported for invalid
stages.The command handles deprecated
stagesvalues during migration.
pre-commit 313 changes
Breaking changes 9
Hooks using language: golang must use go.mod to specify dependencies.
The pre-commit-validate-config command is removed; use pre-commit validate-config instead.
Use pre-commit validate-config instead of the removed pre-commit-validate-config command.
The pre-commit-validate-manifest command is removed; use pre-commit validate-manifest instead.
Use pre-commit validate-manifest instead of the removed pre-commit-validate-manifest command.
Support for Python versions below 3.8 is dropped.
repo: local no longer provisions an empty git repository.
sha can no longer be used to specify a revision; use pre-commit migrate-config to update.
Top-level list configuration is no longer supported; use pre-commit migrate-config to update.
New APIs and options 2
language: coursier now supports additional_dependencies.
language: coursier now supports repo: local.
Behavior and default changes 1
A hook configured with language: golang bootstraps go if it is not present.
Fixes and other changes 1
The error message for invalid YAML is improved.