pre-commit autoupdate --repo ...
no longer deletes other repos.- #660 issue by @KevinHock.
- #661 PR by @KevinHock.
- Lazily install repositories.
- When running
pre-commit run <hookid>
, pre-commit will only install the necessary repositories. - #637 issue by @webknjaz.
- #639 PR by @asottile.
- When running
- Version defaulting now applies to local hooks as well.
- This extends #556 to apply to local hooks.
- #646 PR by @asottile.
- Add new
repo: meta
hooks.meta
hooks expose some linters of the pre-commit configuration itself.id: check-useless-excludes
: ensures thatexclude
directives actually apply to any file in the repository.id: check-hooks-apply
: ensures that the configured hooks apply to at least one file in the repository.- pre-commit/pre-commit-hooks#63 issue by @asottile.
- #405 issue by @asottile.
- #643 PR by @hackedd.
- #653 PR by @asottile.
- #654 PR by @asottile.
- Allow a specific repository to be autoupdated instead of all repositories.
pre-commit autoupdate --repo ...
- #656 issue by @KevinHock.
- #657 PR by @KevinHock.
- Apply selinux labelling option to docker volumes
- #642 PR by @jimmidyson.
- Add
pre-commit try-repo
commands- The new
try-repo
takes a repo and will run the hooks configured in that hook repository. - An example invocation:
pre-commit try-repo https://github.com/pre-commit/pre-commit-hooks
pre-commit try-repo
can also take all the same arguments aspre-commit run
.- It can be used to try out a repository without needing to configure it.
- It can also be used to test a hook repository while developing it.
- #589 issue by @sverhagen.
- #633 PR by @asottile.
- The new
- Add
pygrep
languagepygrep
aims to be a more cross-platform alternative topcre
hooks.- #630 PR by @asottile.
- Use
pipes.quote
for executable path in hook template- Fixes bash syntax error when git dir contains spaces
- #626 PR by @asottile.
- Clean up hook template
- Simplify code
- Fix
--config
not being respected in some situations - #627 PR by @asottile.
- Use
file://
protocol for cloning under test- Fix
file://
clone paths being treated as urls for golang - #629 PR by @asottile.
- Fix
- Add
ctypes
as an import for virtualenv healthchecks- Fixes python3.6.2 <=> python3.6.3 virtualenv invalidation
- e70825ab by @asottile.
- pre-commit can successfully install commit-msg hooks
- Due to an oversight, the commit-msg-tmpl was missing from the packaging
- #623 issue by @sobolevn.
- #624 PR by @asottile.
- pre-commit also checks the
ssl
module for virtualenv health- Suggestion by @merwok.
- #619 PR by @asottile.
- pre-commit no longer crashes with unstaged files when run for the first time
- #620 #621 issue by @Lucas-C.
- #622 PR by @asottile.
- pre-commit configuration gains a
fail_fast
option.- You must be using the v2 configuration format introduced in 1.0.0.
fail_fast
defaults tofalse
.- #240 issue by @Lucas-C.
- #616 PR by @asottile.
- pre-commit configuration gains a global
exclude
option.- This option takes a python regular expression and can be used to exclude files from all hooks.
- You must be using the v2 configuration format introduced in 1.0.0.
- #281 issue by @asieira.
- #617 PR by @asottile.
- Fix a regression in the return code of
pre-commit autoupdate
pre-commit migrate-config
andpre-commit autoupdate
return 0 when successful.- #614 PR by @asottile.
pre-commit will now be following semver. Thanks to all of the contributors that have helped us get this far!
-
pre-commit's cache directory has moved from
~/.pre-commit
to$XDG_CACHE_HOME/pre-commit
(usually~/.cache/pre-commit
).pre-commit clean
now cleans up both the old and new directory.- If you were caching this directory in CI, you'll want to adjust the location.
- #562 issue by @nagromc.
- #602 PR by @asottile.
-
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:
- #414 issue by @asottile.
- #610 PR by @asottile.
- The new format has a top-level map instead of a top-level list. The
new format puts the hook repositories in a
- 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
.
- Allow --config to affect
pre-commit install
- Tweak not found error message during
pre-push
/commit-msg
- Improve node support when running under cygwin.
- Fix
--all-files
, detection of staged files, detection of manually edited files during merge conflict, and detection of files to push for non-ascii filenames.
- Only mention locking when waiting for a lock.
- Fix
IOError
during locking in timeout situtation on windows under python 2.
- Add a new
docker_image
language type.docker_image
is intended to be a lightweight hook type similar tosystem
/script
which allows one to use an existing docker image that provides a hook.docker_image
hooks can also be used as repositorylocal
hooks.
- Fix typos in help
- Allow
commit-msg
hook to be uninstalled - Upgrade the
sample-config
- Remove undocumented
--no-stash
and--allow-unstaged-config
- Remove
validate_config
hook pre-commit hook. - Fix installation race condition when multiple
pre-commit
processes would attempt to install the same repository.
- autoupdate attempts to maintain config formatting.
- Initialize submodules in hook repositories.
- Improve node support when running under cygwin.
- Remove backward compatibility with repositories providing metadata via
hooks.yaml
. New repositories should provide.pre-commit-hooks.yaml
. Runpre-commit autoupdate
to upgrade to the latest repositories. - Improve golang support when running under cygwin.
- Fix crash with unstaged trailing whitespace additions while git was
configured with
apply.whitespace = error
. - Fix crash with unstaged end-of-file crlf additions and the file's lines
ended with crlf while git was configured with
core-autocrlf = true
.
- Add support for the
commit-msg
git hook
- Recover from invalid python virtualenvs
- Work around a windows-specific virtualenv bug pypa/virtualenv#1062 This failure mode was introduced in 0.15.1
- Use a more intelligent default language version for python
- Add
types
andexclude_types
for filtering files. These options take an array of "tags" identified for each file. The tags are sourced from identify. One can list the tags for a file by runningidentify-cli filename
. files
is now optional (defaulting to''
)always_run
+ missingfiles
also defaults tofiles: ''
(previously it defaulted to'^$'
(this reverses e150921c).
- Expose
--origin
and--source
asPRE_COMMIT_ORIGIN
andPRE_COMMIT_SOURCE
environment variables when running aspre-push
.
- Use
--no-ext-diff
when runninggit diff
- Don't crash when
always_run
isTrue
andfiles
is not provided. - Set
VIRTUALENV_NO_DOWNLOAD
when making python virtualenvs.
- Add a
pre-commit sample-config
command - Enable ansi color escapes on modern windows
autoupdate
now defaults to--tags-only
, use--bleeding-edge
for the old behavior- Add support for
log_file
in hook configuration to tee hook output to a file for CI consumption, etc. - Fix crash with unicode commit messages during merges in python 2.
- Add a
pass_filenames
option to allow disabling automatic filename positional arguments to hooks.
- Fix regression in 0.13.5: allow
always_run
andfiles
together despite doing nothing.
- 0.13.4 contained incorrect files
- Add
--show-diff-on-failure
option topre-commit run
- Replace
jsonschema
with better error messages
- Add
--allow-missing-config
to install: allowsgit commit
without a configuration.
- Version the local hooks repo
- Allow
minimum_pre_commit_version
for local hooks
- Fix dummy gem for ruby local hooks
- Autoupdate now works even when the current state is broken.
- Improve pre-push fileset on new branches
- Allow "language local" hooks, hooks which install dependencies using
additional_dependencies
andlanguage
are now allowed inrepo: local
.
- Fix docker hooks on older (<1.12) docker
- golang hooks now support additional_dependencies
- Added a --tags-only option to pre-commit autoupdate
- The new default file for implementing hooks in remote repositories is now .pre-commit-hooks.yaml to encourage repositories to add the metadata. As such, the previous hooks.yaml is now deprecated and generates a warning.
- Fix bug with local configuration interfering with ruby hooks
- Added support for hooks written in golang.
- SwiftPM support.
- shlex entry of docker based hooks.
- Make shlex behaviour of entry more consistent.
- Add an
install-hooks
command similar toinstall --install-hooks
but without theinstall
side-effects. - Adds support for docker based hooks.
- Warn when cygwin / python mismatch
- Add --config for customizing configuration during run
- Update rbenv + plugins to latest versions
- pcre hooks now fail when grep / ggrep are not present
- Fix python hook installation when a strange setup.cfg exists
- Remove some python2.6 compatibility
- UI is no longer sized to terminal width, instead 80 characters or longest necessary width.
- Fix inability to create python hook environments when using venv / pyvenv on osx
- Remove some python2.6 compatibility
- Fix staged-files-only with external diff tools
- Only consider forward diff in changed files
- Don't run on staged deleted files that still exist
- Autoupdate to tags when available
- Stop supporting python2.6
- Fix crash with staged files containing unstaged lines which have non-utf8 bytes and trailing whitespace
- Fix a crash introduced in 0.8.0 when an executable was not found
- Fix regression introduced in 0.8.0 when already using rbenv with no configured ruby hook version
- Fix --files when running in a subdir
- Improve --help a bit
- Switch to pyterminalsize for determining terminal size
- Work under latest virtualenv
- No longer create empty directories on windows with latest virtualenv
- Consider dead symlinks as files when committing
- Produce error message instead of crashing on non-utf8 installation failure
- Fix regression introduced in 0.7.1 breaking
git commit -a
- Add
always_run
setting for hooks to run even without file changes.
- Support running pre-commit inside submodules
- Store state about additional_dependencies for rollforward/rollback compatibility
- Build as a universal wheel
- Allow '.format('-like strings in arguments
- Add an option to require a minimum pre-commit version
- Print a useful message when a hook id is not present
- Fix printing of non-ascii with unexpected errors
- Print a message when a hook modifies files but produces no output
- Add
additional_dependencies
to hook configuration. - Fix pre-commit cloning under git 2.6
- Small improvements for windows
- Allow args for pcre hooks
- Fix regression introduced in 0.6.3 regarding hooks which make non-utf8 diffs
- Remove
expected_return_code
- Fail a hook if it makes modifications to the working directory
- Use --no-ri --no-rdoc instead of --no-document for gem to fix old gem
- Fix pre-push when pushing something that's already up to date
- Filter hooks by stage (commit, push).
- Change permissions a few files
- Rename the validate entrypoints
- Add --version to some entrypoints
- Add --no-document to gem installations
- Use expanduser when finding the python binary
- Suppress complaint about $TERM when no tty is attached
- Support pcre hooks on osx through ggrep
- Allow hooks to produce outputs with arbitrary bytes
- Fix pre-commit install when .git/hooks/pre-commit is a dead symlink
- Allow an unstaged config when using --files or --all-files
- Fix autoupdate with "local" hooks - don't purge local hooks.
- Fix autoupdate with "local" hooks
- Fix bug with unknown non-ascii hook-id
- Avoid crash when .git/hooks is not present in some git clients
- Add a new "local" hook type for running hooks without remote configuration.
- Complain loudly when .pre-commit-config.yaml is unstaged.
- Better support for multiple language versions when running hooks.
- Allow exclude to be defaulted in repository configuration.
- Use sys.executable when executing virtualenv
- Use reset instead of checkout when checkout out hook repo
- Limit length of xargs arguments to workaround windows xargs bug
- Don't rename across devices when creating sqlite database
- Make ^C^C During installation not cause all subsequent runs to fail
- Print while installing (instead of while cloning)
- Use sqlite to manage repositories (instead of symlinks)
- MVP Windows support
args
in venv'd languages are now property quoted.
- Support running during
pre-push
. See http://pre-commit.com/#advanced 'pre-commit during push'.
- Allow hook providers to default
args
inhooks.yaml
- Improve message for
CalledProcessError
- Fix for
staged_files_only
with color.diff = always #176.
- Fix error clobbering #174.
- Remove dependency on
plumbum
. - Allow pre-commit to be run from anywhere in a repository #175.
- Add
--files
option topre-commit run
- Fix terminal width detection (broken in 0.2.10)
- Bump version of nodeenv to fix bug with ~/.npmrc
- Choose
python
more intelligently when running.
- Fix bug where sys.stdout.write must take
bytes
in python 2.6
- Allow a client to have duplicates of hooks.
- Use --prebuilt instead of system for node.
- Improve some fatal error messages
- Produce output when running pre-commit install --install-hooks
- Print hookid on failure
- Use sys.executable for running nodeenv
- Allow running as
python -m pre_commit
- Default columns to 80 (for non-terminal execution).
- Support --install-hooks as an argument to
pre-commit install
- Install hooks before attempting to run anything
- Use
python -m nodeenv
instead ofnodeenv
- Freeze ruby building infrastructure
- Fix bug that assumed diffs were utf-8
- Fix filenames with spaces
- Use either
pre-commit
orpython -m pre_commit.main
depending on which is available - Don't use readlink -f
- Fix for merge-conflict during cherry-picking.
- Add -V / --version
- Add migration install mode / install -f / --overwrite
- Add
pcre
"language" for perl compatible regexes - Reorganize packages.
- Fixed bug with autoupdate setting defaults on un-updated repos.
- Initial Release