diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b938a7..48b39e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ -* Renamed `master` branch to `main` +## 3.0.0 + +**Breaking API change on `lintmigrations` command**: +* the positional argument `GIT_COMMIT_ID` becomes an optional argument with the named parameter ` --git-commit-id [GIT_COMMIT_ID]` +* the `lintmigrations` command takes now two positional arguments: `lintmigrations [app_label] [migration_name]` + +Miscellaneous: * Add complete and working support for `toml` configuration files +* Renamed `master` branch to `main` ## 2.5.3 diff --git a/docs/usage.md b/docs/usage.md index 93c25f1..e50c628 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -4,17 +4,28 @@ The linter is installed as a Django app and is integrated through the Django management command system. -`python manage.py lintmigrations [GIT_COMMIT_ID] ...` +`python manage.py lintmigrations [app_label] [migration_name]` + +The three main usages are: + +* Lint your entire code base +`python manage.py lintmigrations` + +* Lint one Django app +`python manage.py lintmigrations app_label` + +* Lint a specific migration +`python manage.py lintmigrations app_label migration_name` Below the detailed command line options, which can all also be defined using a config file (`setup.cfg`, `tox.ini`, `.django_migration_linter.cfg`): | Parameter | Description | |--------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------| -|`GIT_COMMIT_ID` | If specified, only migrations since this commit will be taken into account. If not specified, all migrations will be linted.| +|`--git-commit-id GIT_COMMIT_ID` | If specified, only migrations since this commit will be taken into account. | |`--ignore-name-contains IGNORE_NAME_CONTAINS` | Ignore migrations containing this name. | |`--ignore-name IGNORE_NAME [IGNORE_NAME ...]` | Ignore migrations with exactly one of these names. | -|`--include-name-contains INCLUDE_NAME_CONTAINS` | Include migrations containing this name. | -|`--include-name INCLUDE_NAME [INCLUDE_NAME ...]` | Include migrations with exactly one of these names. | +|`--include-name-contains INCLUDE_NAME_CONTAINS` | Include migrations containing this name. | +|`--include-name INCLUDE_NAME [INCLUDE_NAME ...]` | Include migrations with exactly one of these names. | |`--include-apps INCLUDE_APPS [INCLUDE_APPS ...]` | Check only migrations that are in the specified django apps. | |`--exclude-apps EXCLUDE_APPS [EXCLUDE_APPS ...]` | Ignore migrations that are in the specified django apps. | |`--exclude-migration-tests MIGRATION_TEST_CODE [...]` | Specify backward incompatible migration tests to be ignored using the code (e.g. ALTER_COLUMN). | @@ -67,5 +78,5 @@ The migration test codes can be found in the [corresponding source code files](. ## Production usage example [3YOURMIND](https://www.3yourmind.com/) is running the linter on every build getting pushed through CI. -That enables to be sure that the migrations will allow A/B testing, Blue/Green deployment and they won't break your development environment. +That enables to be sure that the migrations will allow A/B testing, Blue/Green deployment, and they won't break your development environment. A non-zero error code is returned to express that at least one invalid migration has been found.