NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #3008 most downloaded on PyPI
Some out-of-the-box hooks for pre-commit.
Last release 1 years ago
09 Aug 2025
Ships fairly regularly
a new release about every 6 months
Nearly every release is documented
notes for 54 of 54 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
54 releases · first in 2014
check-shebang-scripts-are-executable: improve error message.
check-shebang-scripts-are-executable: improve error message.
file-contents-sorter: disallow --unique and --ignore-case at the same
time.
check-byte-order-marker and fix-encoding-pragma.
check-byte-order-marker: migrate to fix-byte-order-marker.fix-encoding-pragma: migrate to pyupgrade.use non-deprecated names for stages.
requirements-txt-fixer: also remove pkg_resources==....
check-illegal-windows-names: new hook!
pretty-format-json: continue processing even if a file has a json error.
destroyed-symlinks: set stages to [pre-commit, pre-push, manual]
pre-commit>=3.2.0.stages.
One column per quarter.
fix-encoding-pragma: deprecated -- will be removed in 5.0.0. use pyupgrade or some other tool.
requirements-txt-fixer: remove duplicate packages.
fix-encoding-pragma: deprecated -- will be removed in 5.0.0. use
pyupgrade or some other tool.
requirements-txt-fixer: also sort constraints.txt by default.
requirements-txt-fixer: also sort constraints.txt by default.
debug-statements: add bpdb debugger.
file-contents-sorter: fix sorting an empty file.
double-quote-string-fixer: don't rewrite inside f-strings in 3.12+.
forbid-submodules: new hook which outright bans submodules.
check-executables-have-shebangs: use git config core.fileMode to determine if it should query git.
check-executables-have-shebangs: use git config core.fileMode to determine if it should query git.
name-tests-test: add --pytest-test-first test convention.
check-shebang-scripts-are-executable: update windows instructions.
check-toml: use stdlib tomllib when available.
check-added-large-files: don't run on non-file stages.
name-tests-test: updated display text.
name-tests-test: updated display text.
check-docstring-first: make output more parsable.
check-merge-conflict: make output more parsable.
debug-statements: make output more parsable.
check-merge-conflict: fix detection of ====== conflict marker on windows.
master to main.
debug-statements: add pdbr debugger.
debug-statements: add pdbr debugger.
detect-private-key: add detection for additional key types.
check-executables-have-shebangs: improve messaging on windows.
check-added-large-files: support --enforce-all with git-lfs.
check-case-conflict: improve performance.
forbid-new-submodules: fix false-negatives for pre-push.
check-merge-conflict: fix execution in git worktrees.
check-shebang-scripts-are-executable fix entry point.
check-shebang-scripts-are-executable fix entry point.
Remove deprecated hooks: flake8, pyflakes, autopep8-wrapper.
check-json: report duplicate keys.
no-commit-to-branch: add main to default blocked branches.
check-case-conflict: check conflicts in directory names as well.
check-vcs-permalinks: forbid other branch names.
check-shebang-scripts-are-executable: new hook which ensures shebang'd scripts are executable.
check-executables-have-shebangs: Short circuit shebang lookup on windows.
requirements-txt-fixer: Fix comments which have indentation
pretty-format-json: write to stdout using UTF-8 encoding.
flake8, pyflakes, autopep8-wrapper.
file-contents-sorter: Add --unique argument
file-contents-sorter: Add --unique argument
check-vcs-permalinks: Add --additional-github-domain option
destroyed-symlinks to detect unintentional symlink-breakages on windows.
check-byte-order-marker is now deprecated for fix-byte-order-marker
file-contents-sorter: add --ignore-case option for case-insensitive sorting
check-added-large-files: add --enforce-all option to check non-added files as well
fix-byte-order-marker: new hook which fixes UTF-8 byte-order marker.
check-byte-order-marker is now deprecated for fix-byte-order-markerdebug-statements: add support for pydevd_pycharm debugger
debug-statements: add support for pydevd_pycharm debugger
check-executables-have-shebangs: fix git-quoted files on windows (spaces, non-ascii, etc.)
check-executables-have-shebangs: on windows, validate the mode bits using git
check-executables-have-shebangs: on windows, validate the mode bits using git
requirements-txt-fixer: support more operators
pre-commit-hooks-removed: Fix when removed hooks used args
check-toml: use UTF-8 encoding to load toml files
check-toml: use UTF-8 encoding to load toml files
detect-aws-credentials: skip empty aws keys
detect-aws-credentials: skip empty aws keys
debug-statements: add detection wdb debugger
requirements-txt-fixer: support line continuation for dependencies
detect-aws-credentials: fix UnicodeDecodeError when running on non-UTF8 files.
pre-commit/pre-commit-hooks now requires python3.6.1+
flake8 / pyflakes have been removed, use flake8 from pycqa/flake8
instead:
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.1
hooks:
- id: flake8
Fix sorting of requirements which use egg=...
egg=...
Use flake8 from pycqa/flake8 instead:
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.9
hooks:
- id: flake8
Add diff output to pretty-format-json when run without --autofix.
pretty-format-json when run without --autofix.
--chars option to trailing-whitespace fixer to control which characters are stripped instead of all whitespace.
requirements-txt-fixer when file does not end in a newline.
pretty-format-json.
Add rpdb to detected debuggers in debug-statements
rpdb to detected debuggers in debug-statements
check-toml hook
__main__ block to pre_commit.file_contents_sorter so it can be invoked using python -m
git-lfs tests in azure pipelines
Handle CRLF line endings in double-quote-string-fixer
double-quote-string-fixer
Handle CRLF line endings in fix-encoding-pragma
fix-encoding-pragma
### Fixes - Use UTF-8 to load yaml files - #377 issue by @roottool. - #378 PR by @roottool.
Switch from pyyaml to ruamel.yaml
pyyaml to ruamel.yaml
--pattern option to no-commit-to-branch for regex matching branch names.
require_serial: true for flake8
check-executables-have-shebangs / trailing-whitespace hooks during the commit-msg stage.
check-byte-order-marker against types: [text]
check-docstring-first
pre-commit-hooks now is type checked with mypy.
Clarify autopep8-wrapper is deprecated in description
detect-private-key
mixed-line-endings
end-of-file-fixer
detect-aws-credentials
autopep8-wrapper is deprecated in description
autopep8-wrapper has been moved to [pre-commit/mirrors-autopep8][mirrors-autopep8]
autopep8-wrapper has been moved to pre-commit/mirrors-autopep8
trailing-whitespace defaults to --no-markdown-linebreak-ext
hooks.yaml (legacy pre-commit hook metadata) deleted
types compatibility metadata removed
no-commit-to-branch
pre-commit is now 0.15.0autopep8 from pre-commit/mirrors-autopep8trailing-whitespace use args: [--markdown-linebreak-ext=md,markdown] (the previous default value)no-commit-to-branch: allow --branch to be specified multiple times
no-commit-to-branch: allow --branch to be specified multiple times
check-merge-conflict: add --assume-in-merge to force checks outside of a merge commit situation
ResourcesWarnings
Add an --unsafe argument to check-yaml to allow custom yaml tags
--unsafe argument to check-yaml to allow custom yaml tags
pkg-resources==0.0.0 in requirements-txt-fixer
breakpoint() (python3.7+) in debug-statements hook.
detect-private-key
autopep8-wrapper, check-docstring-first, double-quote-string-fixer)
AttributeError in check-builtin-literals for some functions
trailing-whitespace entrypoint was incorrect.
trailing-whitespace entrypoint was incorrect.
trailing-whitespace no longer adds a missing newline at end-of-file
trailing-whitespace no longer adds a missing newline at end-of-file
detect-aws-credentials false positive when key was empty
detect-aws-credentials false positive when key was empty
no-commit-to-branch no longer crashes when not on a branch
Add new check-builtin-literals hook.
check-builtin-literals hook.
pretty-format-json no longer depends on simplejson.
detect-private-key now detects gcp keys.
Fix output interleaving in check-vcs-permalinks under python3.
check-vcs-permalinks under python3.
check-yaml gains a --allow-multiple-documents (-m) argument to allow linting of files using the multi document syntax
check-yaml gains a --allow-multiple-documents (-m) argument to allow linting of files using the multi document syntax
New hook: check-vcs-permalinks for ensuring permalinked github urls.
check-vcs-permalinks for ensuring permalinked github urls.
trailing-whitespace for non-utf8 files on macos
requirements-txt-fixer for files ending in comments
Fix mixed-line-endings --fix=... when whole file is a different ending
--fix=... when whole file is a different endingFix entry point for mixed-line-ending
mixed-line-ending- New hook: mixed-line-ending
mixed-line-endingReport full python version in check-ast.
check-ast.name-tests-testgit-lfs for check-added-large-files. The oldest
version that is supported is 2.2.1 (2.2.0 will incorrectly refer to all
files as "lfs" (false negative) and earlier versions will crash.debug-statements now works for non-utf-8 files.Add check-executables-have-shebangs hook.
check-executables-have-shebangs hook.Fix requirements-txt-fixer for empty files
sort-simple-yaml hookrequirements-txt-fixer for empty filesfile-contents-sorter hook for sorting flat filescheck-merge-conflict now recognizes rebase conflictstypes (and therefore requires pre-commit 0.15.0). This
allows the text processing hooks to match all text files (and to match
files which would only be classifiable by their shebangs).Add flag allowing missing keys to detect-aws-credentials
detect-aws-credentialstests.py in name-tests-test--no-ensure-ascii option to pretty-format-jsonno-commit-to-branch hookDon't false positive on files where trailing whitespace isn't changed.
Improve search for detecting aws keys
trailing-whitespace-hook: restore original file on catastrophic failure
Merge conflict detection no longer crashes on binary files
Add a --no-sort-keys to json pretty formatter
check-large-files-added understands git-lfs
Add --django to test name checker
Respect configuration when running autopep8
Fix trailing-whitespace on OS X
- Add autopep8-wrapper hook
- Add check-json hook
Don't crash on non-parseable files for debug-statement-hook
- Initial Release
Your coding agent can read these notes before it upgrades. Set up the MCP server →