A pre-commit hook for the Alembic migration tool that ensures database migration integrity and best practices.
- Validates Alembic migration files for common issues and best practices
- Helps maintain a clean and consistent migration history
- Easy integration with pre-commit framework
- Extensible design for adding new validation rules
Add this to your .pre-commit-config.yaml:
repos:
- repo: https://github.com/phildp/alembic-check
rev: v0.1.0 # Use the latest release
hooks:
- id: alembic-check
args: [src/config/alembic/migrations/] # Path to your migrations directory# Run tests
make test
# Run linting
make pre-commit