This repository uses pre-commit hooks to automatically format code on every commit.
Install dependencies (if not already installed):
pip install -r requirements-dev.txt
Or install individually:
pip install pre-commit ruff
Install pre-commit hooks:
pre-commit install
This will set up the git hooks to run automatically on every commit.
Optional: Run on all files (to format existing code):
pre-commit run --all-files
Once installed, pre-commit will automatically:
You can also run the formatters manually:
# Run all hooks on staged files
pre-commit run
# Run all hooks on all files
pre-commit run --all-files
# Run a specific hook
pre-commit run ruff --all-files
pre-commit run prettier --all-files
.pre-commit-config.yaml: Pre-commit hooks configurationpyproject.toml: Ruff configuration (Python formatting and linting).prettierrc: Prettier configuration (JavaScript/TypeScript formatting).prettierignore: Files to exclude from Prettier formattingTo update pre-commit hooks to their latest versions:
pre-commit autoupdate
If hooks fail, you can:
Skip hooks for a specific commit (not recommended):
git commit --no-verify
Update hook versions:
pre-commit autoupdate
Clear pre-commit cache:
pre-commit clean