Skip to content
This repository was archived by the owner on Jun 22, 2021. It is now read-only.

Commit f532f50

Browse files
authored
Update README.md
1 parent ee8da6f commit f532f50

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,41 @@
11
# django-makemigrations
2-
Run Django's makemigrations as a pre-commit hook.
2+
Run Django's [makemigrations](https://docs.djangoproject.com/en/3.1/ref/django-admin/#django-admin-makemigrations) as a pre-commit hook.
3+
4+
5+
# graphene-django-precommit-hook
6+
[pre-commit](https://pre-commit.com) hook to generate [django migrations](https://docs.djangoproject.com/en/3.1/ref/django-admin/#django-admin-makemigrations)
7+
8+
9+
See [pre-commit](https://github.com/pre-commit/pre-commit) for installation instructions
10+
11+
12+
Sample basic `.pre-commit-config.yaml`
13+
14+
```yaml
15+
- repo: https://github.com/tj-pre-commit/django-makemigrations
16+
rev: v1.0.0
17+
hooks:
18+
- id: django-makemigrations
19+
stages: [commit]
20+
```
21+
22+
23+
Sample complex `.pre-commit-config.yaml`
24+
25+
```yaml
26+
- repo: https://github.com/tj-pre-commit/django-makemigrations
27+
rev: v1.0.0
28+
hooks:
29+
- id: django-makemigrations
30+
stages: [commit]
31+
args: [
32+
'--settings',
33+
'project.settings', # Defaults to: DJANGO_SETTINGS_MODULE
34+
'--merge', # Enables fixing of migration conflicts.
35+
'--empty', # Creates an empty migration.
36+
'--no-input', # Do not prompt for user input.
37+
'--verbosity', # OR '-v'
38+
'2', # Set the verbosity level {0,1,2,3}
39+
# See https://docs.djangoproject.com/en/3.1/ref/django-admin/#makemigrations for more information
40+
]
41+
```

0 commit comments

Comments
 (0)