From bf525ae79d597687b990c2d297357967d5f25f64 Mon Sep 17 00:00:00 2001 From: David Wobrock Date: Wed, 26 May 2021 17:24:25 +0200 Subject: [PATCH] Make git commit id a named CLI parameter --- .../management/commands/lintmigrations.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/django_migration_linter/management/commands/lintmigrations.py b/django_migration_linter/management/commands/lintmigrations.py index 66c112e..9826ad2 100644 --- a/django_migration_linter/management/commands/lintmigrations.py +++ b/django_migration_linter/management/commands/lintmigrations.py @@ -27,14 +27,12 @@ class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument( - "commit_id", - metavar="GIT_COMMIT_ID", + "--git-commit-id", type=str, nargs="?", help=( "if specified, only migrations since this commit " - "will be taken into account. If not specified, " - "the initial repo commit will be used" + "will be taken into account" ), ) parser.add_argument( @@ -193,7 +191,7 @@ class Command(BaseCommand): warnings_as_errors=config["warnings_as_errors"], ) linter.lint_all_migrations( - git_commit_id=options["commit_id"], + git_commit_id=options["git_commit_id"], migrations_file_path=options["include_migrations_from"], ) linter.print_summary()