pre-commit will now be following semver. Thanks to all of the contributors that have helped us get this far!
Features
-
pre-commit's cache directory has moved from
~/.pre-commit
to$XDG_CACHE_HOME/pre-commit
(usually~/.cache/pre-commit
). -
A new configuration format for
.pre-commit-config.yaml
is introduced which
will enable future development.- The new format has a top-level map instead of a top-level list. The new format puts the hook repositories in a
repos
key. - Old list-based configurations will continue to be supported.
- A command
pre-commit migrate-config
has been introduced to "upgrade" the configuration format to the new map-based configuration. pre-commit autoupdate
now automatically callsmigrate-config
.- In a later release, list-based configurations will issue a deprecation warning.
- An example diff for upgrading a configuration:
+repos: - repo: https://github.com/pre-commit/pre-commit-hooks sha: v0.9.2 hooks:
- The new format has a top-level map instead of a top-level list. The new format puts the hook repositories in a
Updating
- Run
pre-commit migrate-config
to convert.pre-commit-config.yaml
to the new map format. - Update any references from
~/.pre-commit
to~/.cache/pre-commit
.