mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-09 06:24:52 +03:00
Added a pre-commit check to fail in case user forgot to commit migration files
This commit is contained in:
parent
8060df4c51
commit
7d8bf4eaf5
|
@ -49,6 +49,19 @@ repos:
|
|||
- id: djlint-reformat-django
|
||||
- id: djlint-django
|
||||
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: check-migrations
|
||||
name: check-migrations
|
||||
{%- if cookiecutter.use_docker == 'y' %}
|
||||
entry: /usr/bin/env bash -c "bash .envs/.local/.django && bash .envs/.local/.postgres && docker compose -f local.yml run --rm django bash -c 'python manage.py makemigrations --check --dry-run'"
|
||||
{%- else %}
|
||||
entry: /usr/bin/env bash -c "bash .envs/.local/.django && bash .envs/.local/.postgres && python manage.py makemigrations --check --dry-run"
|
||||
{%- endif %}
|
||||
types: [ python ]
|
||||
pass_filenames: false
|
||||
language: system
|
||||
|
||||
# sets up .pre-commit-ci.yaml to ensure pre-commit dependencies stay up to date
|
||||
ci:
|
||||
autoupdate_schedule: weekly
|
||||
|
|
Loading…
Reference in New Issue
Block a user