Apply isort to the project
This commit is contained in:
1 parent
4b15e11faa
commit
6ab1d58c47
15 files changed
+27
-19
No files matched your search
@@ -16,6 +16,7 @@ Features/fixes:
|
||||
|
||||
Others:
|
||||
* Switched from Travis CI to GitHub Actions for tests
|
||||
* Apply `isort` to the project
|
||||
|
||||
## 2.4.1
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
theme: jekyll-theme-slate
|
||||
@@ -5,10 +5,9 @@ from importlib import import_module
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
from ..utils import register_linting_configuration_options
|
||||
from ...constants import __version__
|
||||
|
||||
from ...migration_linter import MigrationLinter, MessageType
|
||||
from ...migration_linter import MessageType, MigrationLinter
|
||||
from ..utils import register_linting_configuration_options
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
|
||||
@@ -5,24 +5,24 @@ import inspect
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
from subprocess import Popen, PIPE
|
||||
from enum import Enum, unique
|
||||
from subprocess import PIPE, Popen
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.management import call_command
|
||||
from django.db import DEFAULT_DB_ALIAS, connections, ProgrammingError
|
||||
from django.db import DEFAULT_DB_ALIAS, ProgrammingError, connections
|
||||
from django.db.migrations import RunPython, RunSQL
|
||||
from enum import Enum, unique
|
||||
from six import PY2
|
||||
|
||||
from .cache import Cache
|
||||
from .constants import (
|
||||
DEFAULT_CACHE_PATH,
|
||||
EXPECTED_DATA_MIGRATION_ARGS,
|
||||
DJANGO_APPS_WITH_MIGRATIONS,
|
||||
EXPECTED_DATA_MIGRATION_ARGS,
|
||||
)
|
||||
from .utils import clean_bytes_to_str, get_migration_abspath, split_migration_path
|
||||
from .operations import IgnoreMigration
|
||||
from .sql_analyser import analyse_sql_statements
|
||||
from .utils import clean_bytes_to_str, get_migration_abspath, split_migration_path
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from .analyser import analyse_sql_statements # noqa
|
||||
from .base import BaseAnalyser # noqa
|
||||
from .mysql import MySqlAnalyser # noqa
|
||||
from .postgresql import PostgresqlAnalyser # noqa
|
||||
from .sqlite import SqliteAnalyser # noqa
|
||||
from .analyser import analyse_sql_statements # noqa
|
||||
@@ -0,0 +1,10 @@
|
||||
[flake8]
|
||||
max-line-length = 88
|
||||
|
||||
[isort]
|
||||
multi_line_output = 3
|
||||
include_trailing_comma = True
|
||||
force_grid_wrap = 0
|
||||
use_parentheses = True
|
||||
ensure_newline_before_comments = True
|
||||
line_length = 88
|
||||
@@ -1,8 +1,8 @@
|
||||
import ast
|
||||
import re
|
||||
from os import path
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
from setuptools import find_packages, setup
|
||||
|
||||
PROJECT_DIR = path.abspath(path.dirname(__file__))
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ from django.conf import settings
|
||||
from django.db.migrations import Migration
|
||||
|
||||
from django_migration_linter import (
|
||||
IgnoreMigration,
|
||||
MigrationLinter,
|
||||
analyse_sql_statements,
|
||||
get_migration_abspath,
|
||||
IgnoreMigration,
|
||||
)
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
|
||||
-1
@@ -3,7 +3,6 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
from django_add_default_value import AddDefaultValue
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,5 @@ from __future__ import unicode_literals
|
||||
|
||||
from django.db import models
|
||||
|
||||
|
||||
# class A(models.Model):
|
||||
# field_a = models.IntegerField()
|
||||
-1
@@ -1,7 +1,6 @@
|
||||
# Generated by Django 2.2 on 2020-06-20 15:23
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
from django_add_default_value import AddDefaultValue
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ Including another URLconf
|
||||
1. Import the include() function: from django.urls import include, path
|
||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
from django.contrib import admin
|
||||
from django.conf.urls import url
|
||||
from django.contrib import admin
|
||||
|
||||
urlpatterns = [url("admin/", admin.site.urls)]
|
||||
@@ -1,5 +1,5 @@
|
||||
import unittest
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
from django.db.migrations import Migration
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import unittest
|
||||
|
||||
from django_migration_linter.utils import split_path, split_migration_path
|
||||
from django_migration_linter.utils import split_migration_path, split_path
|
||||
|
||||
|
||||
class SplitPathTestCase(unittest.TestCase):
|
||||
|
||||
Reference in new issue
Block a user