A framework for managing and maintaining multi-language pre-commit hooks.
MIT License
Bot releases are visible (Hide)
Published by asottile over 1 year ago
language: golang
bootstrap go
if not present.
language: coursier
now supports additional_dependencies
and repo: local
ruby-build
to 20221225
.
pre-commit autoupdate
.
repo: local
no longer provisions an empty git
repo.
pre-commit migrate-config
to update.
sha
to specify revision, use pre-commit migrate-config
to update.
pre-commit-validate-config
and pre-commit-validate-manifest
, use pre-commit validate-config
and pre-commit validate-manifest
instead.
language: golang
hooks must use go.mod
to specify dependencies
Published by asottile almost 2 years ago
SKIP
for environment install.
pre-commit run --files
against unmerged paths.
repo: local
hooks.
rust
is now a "first class" language -- supporting language_version
and installation when not present.
r
now uses more-reliable binary installation.
GIT_ALLOW_PROTOCOL
is now passed through for git operations.
GIT_ASKPASS
is now passed through for git operations.
toml
dependency by using cargo add
directly.
dotnet
hooks which have dotted prefixes.
--commit-msg-filename
if run from a sub directory.
--intent-to-add
detection by using git diff
.
R.exe
selection on windows.
nuget
source when installing dotnet
packages.
Published by asottile over 2 years ago
source
and object-name
(positional args) of prepare-commit-msg
hook as PRE_COMMIT_COMIT_MSG_SOURCE
and PRE_COMMIT_COMMIT_OBJECT_NAME
.
language: ruby
installs when --user-install
is set in gemrc.
--config
option from gc
, sample-config
, validate-config
, validate-manifest
sub-commands.
Published by asottile over 2 years ago
language: dotnet
hooks.
healthy()
failure.
pre-commit validate-config
/ pre-commit validate-manifest
and deprecate pre-commit-validate-config
and pre-commit-validate-manifest
.
pre-push
when pushed ref contains spaces.
pre-commit-validate-config
/ pre-commit-validate-manifest
to pre-commit validate-config
/ pre-commit validate-manifest
.
Published by asottile over 2 years ago
repo: local
hooks running python<3.7
Published by asottile over 2 years ago
GIT_HTTP_PROXY_AUTHMETHOD
in git environ.
cs
and coursier
executables for coursier hooks.
language_version
/ additional_dependencies
for languages which do not support them.
ruby-build
.
default_install_hook_types
which will be installed when --hook-types
is not specified in pre-commit install
.
--from-ref
and --to-ref
.
$R_HOME
for R hooks.
master
branch to main
.
Published by asottile over 2 years ago
[\\/]
.
language: conda
to use mamba
or micromamba
via PRE_COMMIT_USE_MAMBA=1
or PRE_COMMIT_USE_MICROMAMBA=1
respectively.
git --version
in error report.
language: lua
as a supported language.
setuptools
to the zipapp.
go install
instead of go get
for go 1.18+ support.
language: r
with a local renv and RENV_PROJECT
set.
entry
in language: meta
hooks which breaks them.
#!/bin/sh
on windows for hook script.
Published by asottile almost 3 years ago
[\/]
or [/\\]
.
bash
resolving shebang-portability issues.
fail_fast
at the individual hook level.
GIT_CONFIG_KEY_*
, GIT_CONFIG_VALUE_*
, and GIT_CONFIG_COUNT
.
core.useBuiltinFSMonitor=true
on windows.
submodule.recurse=1
.
exit(...)
with raise SystemExit(...)
for portability.
Published by asottile about 3 years ago
dart
.
post-rewrite
hooks.
check-useless-excludes
with exclude matching broken symlink.
pre-commit autoupdate
.
Published by asottile about 3 years ago
check-useless-excludes
and check-hooks-apply
matching non-root.pre-commit-config.yaml
.
Published by asottile about 3 years ago
pre-push
hooks, expose local branch as PRE_COMMIT_LOCAL_BRANCH
.
Published by asottile over 3 years ago
SKIP=...
skips installation as well.
repo: local
for r
hooks.
ruby-build
and rbenv
.
r
packages.
renv
versions.
Published by asottile over 3 years ago
Published by asottile over 3 years ago
Published by asottile over 3 years ago
Published by asottile over 3 years ago
post-merge
hook.
r
as a supported hook language.
pre-commit install
on subst
/ network drives on windows.
local
golang repositories for go 1.16.
Published by asottile over 3 years ago
language: golang
repositories containing recursive submodules
Published by asottile over 3 years ago
ci
as a top-level map for configuration for https://pre-commit.ci
rev
in configuration
/*
in top-level files
/ exclude
regexes
PRE_COMMIT_REMOTE_BRANCH
environment variable during pre-push
hooks
language
/ language_version
for non-installable languages
Published by asottile almost 4 years ago
Published by asottile almost 4 years ago
types_or
so symlink
and directory
can be matched