pre-commit git hooks are described in contribution.md, but no example .pre-commit-config.yaml is provided.
By running poetry run pre-commit install this seems to only install .git/hooks/pre-commit.
This pre-commit file correctly runs python pre-commit in the poetry venv, but because a .pre-commit-config.yaml is still missing the commit will always fail until a valid yaml file is created.
(bbot-py3.12) user@dev-box bbot % poetry run pre-commit install
pre-commit installed at .git/hooks/pre-commit
(bbot-py3.12) user@dev-box bbot %
(bbot-py3.12) user@dev-box bbot % cat .git/hooks/pre-commit
#!/usr/bin/env bash
# File generated by pre-commit: https://pre-commit.com
# ID: 138fd403232d2ddd5efb44317e38bf03
# start templated
INSTALL_PYTHON=/Users/user/Library/Caches/pypoetry/virtualenvs/bbot-XnbrUybI-py3.12/bin/python
ARGS=(hook-impl --config=.pre-commit-config.yaml --hook-type=pre-commit)
# end templated
HERE="$(cd "$(dirname "$0")" && pwd)"
ARGS+=(--hook-dir "$HERE" -- "$@")
if [ -x "$INSTALL_PYTHON" ]; then
exec "$INSTALL_PYTHON" -mpre_commit "${ARGS[@]}"
elif command -v pre-commit > /dev/null; then
exec pre-commit "${ARGS[@]}"
else
echo '`pre-commit` not found. Did you forget to activate your virtualenv?' 1>&2
exit 1
fi
(bbot-py3.12) user@dev-box bbot %
Recommended pre-commit git hook config provided in contribution.md,
Description
pre-commit git hooks are described in
contribution.md
, but no example.pre-commit-config.yaml
is provided.By running
poetry run pre-commit install
this seems to only install.git/hooks/pre-commit
.This pre-commit file correctly runs python pre-commit in the poetry venv, but because a
.pre-commit-config.yaml
is still missing the commit will always fail until a valid yaml file is created.Recommended pre-commit git hook config provided in contribution.md,
e.g. something like?