Make git commit id a named CLI parameter

This commit is contained in:
David Wobrock committed 2021-05-26 18:53:19 +02:00
1 parent 91e0147f9b
commit bf525ae79d
1 file changed
+3 -5
@@ -27,14 +27,12 @@ class Command(BaseCommand):
def add_arguments(self, parser): def add_arguments(self, parser):
parser.add_argument( parser.add_argument(
"commit_id", "--git-commit-id",
metavar="GIT_COMMIT_ID",
type=str, type=str,
nargs="?", nargs="?",
help=( help=(
"if specified, only migrations since this commit " "if specified, only migrations since this commit "
"will be taken into account. If not specified, " "will be taken into account"
"the initial repo commit will be used"
), ),
) )
parser.add_argument( parser.add_argument(
@@ -193,7 +191,7 @@ class Command(BaseCommand):
warnings_as_errors=config["warnings_as_errors"], warnings_as_errors=config["warnings_as_errors"],
) )
linter.lint_all_migrations( linter.lint_all_migrations(
git_commit_id=options["commit_id"], git_commit_id=options["git_commit_id"],
migrations_file_path=options["include_migrations_from"], migrations_file_path=options["include_migrations_from"],
) )
linter.print_summary() linter.print_summary()