All notable changes to iprecommit
will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning with regard to the command-line interface, the format of the precommit.py
file, and the APIs documented in the README.
NOTE: As allowed by Semantic Versioning, backwards compatibility is not guaranteed until version 1.0 is released.
Numbers in parentheses after entries refer to issues in the GitHub issue tracker.
- Bug fix:
iprecommit
erroneously examined newly-created untracked files, even when the--unstaged
flag was not passed.
- Bug fix: Installation process is more robust.
- Bug fix: Negative filters (e.g.,
["!*.md"]
) now work correctly. iprecommit run
andiprecommit fix
now take a--skip
flag to optionally skip checks. You can also setskip = true
inprecommit.toml
.iprecommit run
takes an optional--fail-fast
flag.autofix
can be specified inprecommit.toml
on a per-check basis.
- Bug fix: deleted files are no longer passed to commands for
iprecommit run --all
. - Bug fix:
iprecommit run --unstaged
now considers untracked files as well as tracked files with unstaged changes.
fail_fast
option added to TOML.
autofix
option added to TOML.iprecommit-commit-msg-format
now correctly ignores diffs in commit messages.iprecommit-commit-msg-format
now prints correct line numbers.iprecommit-newline-at-eof
now has a--fix
option.- Program output tweaked (e.g., one blank line instead of two between blocks).
working_dir
option forpre_commit
checks- Check command
stderr
output is piped tostdout
. --all
flag foriprecommit run
andiprecommit fix
- Git hooks are replaced atomically instead of overwritten in place.
- The
IPRECOMMIT_TOML_TEMPLATE
environment variable can be used to customize theprecommit.toml
template. iprecommit fix
will stage changes to files after a fix command modifies them.iprecommit-*
commands now ignore files they cannot parse as UTF-8.
- Config format changed from Python (
precommit.py
) to TOML (precommit.toml
).
- Main interface in
precommit.py
is now calledChecks
and has a different API thanPre
. - Pure Python checks are no longer supported. All checks must be external shell commands.
- The
iprecommit
package now includes a set of extra commands:iprecommit-commit-msg-format
,iprecommit-newline-at-eof
, andiprecommit-no-forbidden-strings
More API updates.
API redesigned, again.
PythonBlack()
check is added.NO_COLOR
environment variable is respected.
Precommit.check
andPrecommit.command
takepattern
andexclude
parameters to control what files the checks run on.- The
iprecommit init
command is introduced, to initialize a new pre-commit script from scratch. iprecommit run
andiprecommit fix
now default to operating on both staged and unstaged changes. The--unstaged
flag is removed. For the old behavior, pass--staged
.- User is warned about misconfigured environment variables.
- README is updated to reflect the new API.
Completely redesigned CLI and Python API.
First official release