Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 1.02 KB

File metadata and controls

53 lines (35 loc) · 1.02 KB

Pre-commit

This repo uses pre-commit to run code formatting checks before every commit.

Setup

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 install

Additionally if you want pre-commit to be available in your PATH:

uv tool install pre-commit
pre-commit install

Black will now run automatically on every git commit. Check the config for extra details

Running manually

# 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 black

Bypassing a hook

In an emergency you can skip hooks entirely:

git commit --no-verify

Or skip a specific hook:

SKIP=black git commit

Use sparingly (CI will still catch any formatting issues).