From 6ba40103813df91e7e6daf052f470db3d0dfcecc Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 8 Sep 2021 15:12:05 +0200 Subject: [PATCH] Fix/revisit docs Started with a follow-up to fa9b2f97, which missed applying the fix to docs, and then added some more while reading it. --- README.md | 15 +++++++-------- docs/incompatibilities.md | 2 +- docs/makemigrations.md | 7 ++++++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0935aba..b4b93c7 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ More advanced usages of the linter and options [can be found at docs/usage.md](. ## Integration -One can either integrate the linter in the CI and the `lintmigrations` command, or detect incompatibilities during generation with +One can either integrate the linter in the CI using its `lintmigrations` command, or detect incompatibilities during generation of migrations with ``` $ python manage.py makemigrations --lint @@ -68,23 +68,22 @@ Linting for 'app_correct': (app_correct, 0003_a_column)... ERR NOT NULL constraint on columns -The migration linter detected that this migration is not be backward compatible. +The migration linter detected that this migration is not backward compatible. - If you keep the migration, you will want to fix the issue or ignore the migration. - By default, the newly created migration file will be deleted. -Do you want to keep the migration? [y/N] -[...] +Do you want to keep the migration? [y/N] n Deleted tests/test_project/app_correct/migrations/0003_a_column.py ``` -The linter found that the newly created migration is not backward compatible and deletes the files. -This behaviour can be the default of the `makemigrations` command through the `MIGRATION_LINTER_OVERRIDE_MAKEMIGRATIONS` Django settings. +The linter found that the newly created migration is not backward compatible and deleted the file after confirmation. +This behaviour can be the default of the `makemigrations` command through the `MIGRATION_LINTER_OVERRIDE_MAKEMIGRATIONS` Django setting. Find out more about the [makemigrations command at docs/makemigrations.md](./docs/makemigrations.md). ### More information -Please find more documentation generally [in the docs/ folder](./docs/). +Please find more documentation [in the docs/ folder](./docs/). -Some implementation details [can found in the ./docs/internals/ folder](./docs/internals/). +Some implementation details [can be found in the ./docs/internals/ folder](./docs/internals/). ### Blog post diff --git a/docs/incompatibilities.md b/docs/incompatibilities.md index 2dfef2c..6ee41ba 100644 --- a/docs/incompatibilities.md +++ b/docs/incompatibilities.md @@ -23,7 +23,7 @@ On data migrations, the linter will show a warning when: ## Codes -You can ignore check through the `--exclude-migration-tests` option and specifying any of the codes: +You can ignore checks through the `--exclude-migration-tests` option by specifying any of the codes: | Code | Description | |-----------------------------------|----------------------------------------------------------------------| diff --git a/docs/makemigrations.md b/docs/makemigrations.md index 1a44acd..f2329b8 100644 --- a/docs/makemigrations.md +++ b/docs/makemigrations.md @@ -1,6 +1,6 @@ # makemigrations -The linter can override behaviour of the [Django makemigrations command](https://docs.djangoproject.com/en/dev/ref/django-admin/#django-admin-makemigrations). +The linter can override the behaviour of the [Django makemigrations command](https://docs.djangoproject.com/en/dev/ref/django-admin/#django-admin-makemigrations). Either: * by specifying the `--lint` option in the command line @@ -16,6 +16,11 @@ Migrations for 'app_correct': Linting for 'app_correct': (app_correct, 0003_a_column)... ERR NOT NULL constraint on columns + +The migration linter detected that this migration is not backward compatible. +- If you keep the migration, you will want to fix the issue or ignore the migration. +- By default, the newly created migration file will be deleted. +Do you want to keep the migration? [y/N] n Deleted tests/test_project/app_correct/migrations/0003_a_column.py ```