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:
|
Others:
|
||||||
* Switched from Travis CI to GitHub Actions for tests
|
* Switched from Travis CI to GitHub Actions for tests
|
||||||
|
* Apply `isort` to the project
|
||||||
|
|
||||||
## 2.4.1
|
## 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 django.core.management.base import BaseCommand
|
||||||
|
|
||||||
from ..utils import register_linting_configuration_options
|
|
||||||
from ...constants import __version__
|
from ...constants import __version__
|
||||||
|
from ...migration_linter import MessageType, MigrationLinter
|
||||||
from ...migration_linter import MigrationLinter, MessageType
|
from ..utils import register_linting_configuration_options
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
|
|||||||
@@ -5,24 +5,24 @@ import inspect
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
from subprocess import Popen, PIPE
|
from enum import Enum, unique
|
||||||
|
from subprocess import PIPE, Popen
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.management import call_command
|
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 django.db.migrations import RunPython, RunSQL
|
||||||
from enum import Enum, unique
|
|
||||||
from six import PY2
|
from six import PY2
|
||||||
|
|
||||||
from .cache import Cache
|
from .cache import Cache
|
||||||
from .constants import (
|
from .constants import (
|
||||||
DEFAULT_CACHE_PATH,
|
DEFAULT_CACHE_PATH,
|
||||||
EXPECTED_DATA_MIGRATION_ARGS,
|
|
||||||
DJANGO_APPS_WITH_MIGRATIONS,
|
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 .operations import IgnoreMigration
|
||||||
from .sql_analyser import analyse_sql_statements
|
from .sql_analyser import analyse_sql_statements
|
||||||
|
from .utils import clean_bytes_to_str, get_migration_abspath, split_migration_path
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
from .analyser import analyse_sql_statements # noqa
|
||||||
from .base import BaseAnalyser # noqa
|
from .base import BaseAnalyser # noqa
|
||||||
from .mysql import MySqlAnalyser # noqa
|
from .mysql import MySqlAnalyser # noqa
|
||||||
from .postgresql import PostgresqlAnalyser # noqa
|
from .postgresql import PostgresqlAnalyser # noqa
|
||||||
from .sqlite import SqliteAnalyser # 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 ast
|
||||||
import re
|
import re
|
||||||
from os import path
|
from os import path
|
||||||
from setuptools import setup, find_packages
|
|
||||||
|
|
||||||
|
from setuptools import find_packages, setup
|
||||||
|
|
||||||
PROJECT_DIR = path.abspath(path.dirname(__file__))
|
PROJECT_DIR = path.abspath(path.dirname(__file__))
|
||||||
|
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ from django.conf import settings
|
|||||||
from django.db.migrations import Migration
|
from django.db.migrations import Migration
|
||||||
|
|
||||||
from django_migration_linter import (
|
from django_migration_linter import (
|
||||||
|
IgnoreMigration,
|
||||||
MigrationLinter,
|
MigrationLinter,
|
||||||
analyse_sql_statements,
|
analyse_sql_statements,
|
||||||
get_migration_abspath,
|
get_migration_abspath,
|
||||||
IgnoreMigration,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if sys.version_info >= (3, 3):
|
if sys.version_info >= (3, 3):
|
||||||
|
|||||||
-1
@@ -3,7 +3,6 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
from django_add_default_value import AddDefaultValue
|
from django_add_default_value import AddDefaultValue
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,5 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
# class A(models.Model):
|
# class A(models.Model):
|
||||||
# field_a = models.IntegerField()
|
# field_a = models.IntegerField()
|
||||||
-1
@@ -1,7 +1,6 @@
|
|||||||
# Generated by Django 2.2 on 2020-06-20 15:23
|
# Generated by Django 2.2 on 2020-06-20 15:23
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
from django_add_default_value import AddDefaultValue
|
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
|
1. Import the include() function: from django.urls import include, path
|
||||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||||
"""
|
"""
|
||||||
from django.contrib import admin
|
|
||||||
from django.conf.urls import url
|
from django.conf.urls import url
|
||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
urlpatterns = [url("admin/", admin.site.urls)]
|
urlpatterns = [url("admin/", admin.site.urls)]
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import unittest
|
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import unittest
|
||||||
|
|
||||||
from django.db.migrations import Migration
|
from django.db.migrations import Migration
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import unittest
|
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):
|
class SplitPathTestCase(unittest.TestCase):
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ basepython = python3.6
|
|||||||
deps =
|
deps =
|
||||||
flake8==3.8.4
|
flake8==3.8.4
|
||||||
black==20.8b1
|
black==20.8b1
|
||||||
|
isort==5.6.4
|
||||||
commands =
|
commands =
|
||||||
flake8 --max-line-length=88 django_migration_linter
|
flake8 django_migration_linter/
|
||||||
black --check django_migration_linter/ tests/ manage.py setup.py
|
black --check django_migration_linter/ tests/ manage.py setup.py
|
||||||
|
isort --check-only .
|
||||||
Reference in new issue
Block a user