This directory contains Git hooks to ensure code quality before commits and pushes.
To install the pre-push hook:
# From the project root directory
ln -sf ../../.githooks/pre-push .git/hooks/pre-pushAutomatically runs before each git push to ensure:
- Code formatting: Runs
ruff format --checkand fixes issues if found - Lint checking: Runs
ruff checkto catch code quality issues
If any check fails, the push is blocked until issues are resolved.
You can run the same checks manually:
# Format code
ruff format .
# Check for lint issues
ruff check .
# Run both (recommended before committing)
ruff format . && ruff check .These same checks are also enforced in CI:
.github/workflows/ci-enhanced.ymlruns identical checks- This ensures consistent code quality across all environments
- Local hooks prevent CI failures by catching issues early
In emergencies, you can skip hooks with:
git push --no-verifyHowever, this is strongly discouraged as it bypasses quality gates that prevent CI failures.