One self-contained script. Copy it into hooks/pre-commit/<name>, edit the
header, and chmod +x it. No pip install. The multiplexer runs it as a
subhook.
Works as a silent lint (ruff, mypy, shellcheck, rubocop) or with optional
yes/no prompts on /dev/tty.
Python 3.13 or newer on PATH. The only file you need is
src/pre-commit-template.
cp src/pre-commit-template hooks/pre-commit/01-ruff
chmod +x hooks/pre-commit/01-ruffEdit the header: REQUIRED_COMMANDS, TOOL, FILE_EXTENSIONS. Leave
everything below # STOP HERE alone.
These steps are only for changing this repository.
python -m venv .venv
source .venv/bin/activate
python -m pip install -e ".[dev]"
python -m pytestThe guide is in mkdocs/. After installing the dev
extras:
mkdocs serve