From 9f221165417e5bcd1f653abe878fd2204fb887f4 Mon Sep 17 00:00:00 2001 From: David Wobrock Date: Fri, 7 Feb 2020 22:32:15 +0100 Subject: [PATCH] Black the code --- .../management/commands/lintmigrations.py | 4 +++- django_migration_linter/migration_linter.py | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/django_migration_linter/management/commands/lintmigrations.py b/django_migration_linter/management/commands/lintmigrations.py index ef56d6a..b0da4e6 100644 --- a/django_migration_linter/management/commands/lintmigrations.py +++ b/django_migration_linter/management/commands/lintmigrations.py @@ -110,7 +110,9 @@ class Command(BaseCommand): help="don't print linting messages to stdout", ) parser.add_argument( - "--warnings-as-errors", action="store_true", help="handle warnings as errors", + "--warnings-as-errors", + action="store_true", + help="handle warnings as errors", ) def handle(self, *args, **options): diff --git a/django_migration_linter/migration_linter.py b/django_migration_linter/migration_linter.py index 010d5b5..4c59f75 100644 --- a/django_migration_linter/migration_linter.py +++ b/django_migration_linter/migration_linter.py @@ -14,7 +14,11 @@ from django.db.migrations import RunPython from enum import Enum, unique from .cache import Cache -from .constants import DEFAULT_CACHE_PATH, EXPECTED_DATA_MIGRATION_ARGS, DJANGO_APPS_WITH_MIGRATIONS +from .constants import ( + DEFAULT_CACHE_PATH, + EXPECTED_DATA_MIGRATION_ARGS, + DJANGO_APPS_WITH_MIGRATIONS, +) from .utils import clean_bytes_to_str, get_migration_abspath, split_migration_path from .operations import IgnoreMigration from .sql_analyser import analyse_sql_statements @@ -133,7 +137,9 @@ class MigrationLinter(object): self.exclude_migration_tests, ) - err, ignored_data, warnings = self.analyse_data_migration(app_label, migration_name) + err, ignored_data, warnings = self.analyse_data_migration( + app_label, migration_name + ) if err: errors += err if ignored_data: @@ -403,9 +409,10 @@ class MigrationLinter(object): if tuple(args_spec.args) != EXPECTED_DATA_MIGRATION_ARGS: issue = { "code": "NAMING_CONVENTION_RUNPYTHON_ARGS", - "msg": "'{}': By convention, RunPython names the two arguments: apps, schema_editor".format( - function_name - ), + "msg": ( + "'{}': By convention, " + "RunPython names the two arguments: apps, schema_editor" + ).format(function_name), } if issue["code"] in self.exclude_migration_tests: ignored.append(issue)