Black the code
This commit is contained in:
1 parent
2e7eec42c2
commit
9f22116541
2 files changed
+15
-6
No files matched your search
@@ -110,7 +110,9 @@ class Command(BaseCommand):
|
|||||||
help="don't print linting messages to stdout",
|
help="don't print linting messages to stdout",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
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):
|
def handle(self, *args, **options):
|
||||||
|
|||||||
@@ -14,7 +14,11 @@ from django.db.migrations import RunPython
|
|||||||
from enum import Enum, unique
|
from enum import Enum, unique
|
||||||
|
|
||||||
from .cache import Cache
|
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 .utils import clean_bytes_to_str, get_migration_abspath, split_migration_path
|
||||||
from .operations import IgnoreMigration
|
from .operations import IgnoreMigration
|
||||||
from .sql_analyser import analyse_sql_statements
|
from .sql_analyser import analyse_sql_statements
|
||||||
@@ -133,7 +137,9 @@ class MigrationLinter(object):
|
|||||||
self.exclude_migration_tests,
|
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:
|
if err:
|
||||||
errors += err
|
errors += err
|
||||||
if ignored_data:
|
if ignored_data:
|
||||||
@@ -403,9 +409,10 @@ class MigrationLinter(object):
|
|||||||
if tuple(args_spec.args) != EXPECTED_DATA_MIGRATION_ARGS:
|
if tuple(args_spec.args) != EXPECTED_DATA_MIGRATION_ARGS:
|
||||||
issue = {
|
issue = {
|
||||||
"code": "NAMING_CONVENTION_RUNPYTHON_ARGS",
|
"code": "NAMING_CONVENTION_RUNPYTHON_ARGS",
|
||||||
"msg": "'{}': By convention, RunPython names the two arguments: apps, schema_editor".format(
|
"msg": (
|
||||||
function_name
|
"'{}': By convention, "
|
||||||
),
|
"RunPython names the two arguments: apps, schema_editor"
|
||||||
|
).format(function_name),
|
||||||
}
|
}
|
||||||
if issue["code"] in self.exclude_migration_tests:
|
if issue["code"] in self.exclude_migration_tests:
|
||||||
ignored.append(issue)
|
ignored.append(issue)
|
||||||
|
|||||||
Reference in new issue
Block a user