Bump isort, use --diff (#164)

* dev-requirements: bump isort: 4.3.4 => 4.3.21

* isort: use --diff

* known_first_party = mypy_django_plugin

* Run isort
This commit is contained in:
Daniel Hahler
2019-09-23 19:45:43 +02:00
committed by Maxim Kurnikov
parent a85dbff793
commit afcd0d9293
6 changed files with 21 additions and 10 deletions

View File

@@ -30,7 +30,7 @@ jobs:
- name: Lint plugin code with isort - name: Lint plugin code with isort
python: 3.7 python: 3.7
script: 'isort --check' script: 'isort --check --diff'
before_install: | before_install: |
sudo apt update sudo apt update

View File

@@ -2,5 +2,5 @@ black
pytest-mypy-plugins==1.0.3 pytest-mypy-plugins==1.0.3
psycopg2 psycopg2
flake8 flake8
isort==4.3.4 isort==4.3.21
-e . -e .

View File

@@ -1,18 +1,22 @@
import os import os
from collections import defaultdict from collections import defaultdict
from contextlib import contextmanager from contextlib import contextmanager
from typing import Dict, Iterator, Optional, Set, TYPE_CHECKING, Tuple, Type, Union from typing import (
TYPE_CHECKING, Dict, Iterator, Optional, Set, Tuple, Type, Union,
)
from django.core.exceptions import FieldError from django.core.exceptions import FieldError
from django.db.models.base import Model from django.db.models.base import Model
from django.db.models.fields import AutoField, CharField, Field
from django.db.models.fields.related import ForeignKey, RelatedField from django.db.models.fields.related import ForeignKey, RelatedField
from django.db.models.fields.reverse_related import ForeignObjectRel from django.db.models.fields.reverse_related import ForeignObjectRel
from django.db.models.sql.query import Query from django.db.models.sql.query import Query
from django.utils.functional import cached_property from django.utils.functional import cached_property
from mypy.checker import TypeChecker from mypy.checker import TypeChecker
from mypy.types import AnyType, Instance, Type as MypyType, TypeOfAny from mypy.types import AnyType, Instance
from mypy.types import Type as MypyType
from mypy.types import TypeOfAny
from django.db.models.fields import AutoField, CharField, Field
from mypy_django_plugin.lib import helpers from mypy_django_plugin.lib import helpers
try: try:

View File

@@ -1,15 +1,19 @@
from collections import OrderedDict from collections import OrderedDict
from typing import Any, Dict, List, Optional, Set, TYPE_CHECKING, Union, cast from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Union, cast
from mypy import checker from mypy import checker
from mypy.checker import TypeChecker from mypy.checker import TypeChecker
from mypy.mro import calculate_mro from mypy.mro import calculate_mro
from mypy.nodes import (Block, ClassDef, Expression, GDEF, MDEF, MemberExpr, MypyFile, NameExpr, StrExpr, SymbolNode, from mypy.nodes import (
SymbolTable, SymbolTableNode, TypeInfo, Var) GDEF, MDEF, Block, ClassDef, Expression, MemberExpr, MypyFile, NameExpr, StrExpr, SymbolNode, SymbolTable,
SymbolTableNode, TypeInfo, Var,
)
from mypy.plugin import ( from mypy.plugin import (
AttributeContext, CheckerPluginInterface, FunctionContext, MethodContext, AttributeContext, CheckerPluginInterface, FunctionContext, MethodContext,
) )
from mypy.types import AnyType, Instance, NoneTyp, TupleType, Type as MypyType, TypeOfAny, TypedDictType, UnionType from mypy.types import AnyType, Instance, NoneTyp, TupleType
from mypy.types import Type as MypyType
from mypy.types import TypedDictType, TypeOfAny, UnionType
from mypy_django_plugin.lib import fullnames from mypy_django_plugin.lib import fullnames

View File

@@ -6,7 +6,9 @@ from django.db.models.base import Model
from django.db.models.fields.related import RelatedField from django.db.models.fields.related import RelatedField
from mypy.nodes import Expression, NameExpr from mypy.nodes import Expression, NameExpr
from mypy.plugin import FunctionContext, MethodContext from mypy.plugin import FunctionContext, MethodContext
from mypy.types import AnyType, Instance, Type as MypyType, TypeOfAny from mypy.types import AnyType, Instance
from mypy.types import Type as MypyType
from mypy.types import TypeOfAny
from mypy_django_plugin.django.context import DjangoContext from mypy_django_plugin.django.context import DjangoContext
from mypy_django_plugin.lib import fullnames, helpers from mypy_django_plugin.lib import fullnames, helpers

View File

@@ -6,6 +6,7 @@ skip =
include_trailing_comma = true include_trailing_comma = true
multi_line_output = 5 multi_line_output = 5
wrap_length = 120 wrap_length = 120
known_first_party = mypy_django_plugin
[flake8] [flake8]
exclude = exclude =