This repo uses pre-commit to run code formatting checks before every commit.
Please note: The following assumes already using 'uv' as virtual environment manager. This is not necessary to setup pre-commit.
Install dependencies and wire up the Git hook:
uv sync
uv run pre-commit installAdditionally if you want pre-commit to be available in your PATH:
uv tool install pre-commit
pre-commit installBlack will now run automatically on every git commit.
Check the config for extra details
# Run all hooks against changed files
uv run pre-commit run
# Run against all files in the repo
uv run pre-commit run --all-files
# Run only black
uv run pre-commit run blackIn an emergency you can skip hooks entirely:
git commit --no-verifyOr skip a specific hook:
SKIP=black git commitUse sparingly (CI will still catch any formatting issues).