Some out-of-the-box hooks for pre-commit
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.
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+.
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.
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.
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-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 --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-marker