Skip to content

Commit 5dea70b

Browse files
authored
MPT-17672: add pre-commit hook (#38)
2 parents 8cc9a12 + 2875dd5 commit 5dea70b

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.pre-commit-hooks.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- id: check-migrations
2+
name: Check migrations
3+
entry: mpt-service-cli migrate --check
4+
language: python
5+
pass_filenames: false
6+
files: ^migrations/.*\.py$
7+
exclude: __init__\.py$
8+
description: Check for duplicate migration_id in migration files

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,19 @@ make test args="-k test_cli -vv"
6060
make test args="tests/test_cli.py"
6161
```
6262

63+
## Pre-commit
64+
65+
Checking migrations with pre-commit:
66+
67+
Add this to your .pre-commit-config.yaml
68+
69+
```yaml
70+
- repo: https://github.com/softwareone-platform/mpt-tool
71+
rev: '' # Use the sha / tag you want to point at
72+
hooks:
73+
- id: check-migrations
74+
```
75+
6376
## Developer utilities
6477
6578
Useful helper targets during development:

0 commit comments

Comments
 (0)