Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- id: check-migrations
name: Check migrations
entry: mpt-service-cli migrate --check
language: python
pass_filenames: false
files: ^migrations/.*\.py$
exclude: __init__\.py$
description: Check for duplicate migration_id in migration files
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,19 @@ make test args="-k test_cli -vv"
make test args="tests/test_cli.py"
```

## Pre-commit

Checking migrations with pre-commit:

Add this to your .pre-commit-config.yaml

```yaml
- repo: https://github.com/softwareone-platform/mpt-tool
rev: '' # Use the sha / tag you want to point at
hooks:
- id: check-migrations
```

## Developer utilities

Useful helper targets during development:
Expand Down