Skip to content

Commit

Permalink
Bump isort, use --diff (typeddjango#164)
Browse files Browse the repository at this point in the history
* dev-requirements: bump isort: 4.3.4 => 4.3.21

* isort: use --diff

* known_first_party = mypy_django_plugin

* Run isort
  • Loading branch information
blueyed authored and mkurnikov committed Sep 23, 2019
1 parent a85dbff commit afcd0d9
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- name: Lint plugin code with isort
python: 3.7
script: 'isort --check'
script: 'isort --check --diff'

before_install: |
sudo apt update
Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ black
pytest-mypy-plugins==1.0.3
psycopg2
flake8
isort==4.3.4
isort==4.3.21
-e .
10 changes: 7 additions & 3 deletions mypy_django_plugin/django/context.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import os
from collections import defaultdict
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.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.reverse_related import ForeignObjectRel
from django.db.models.sql.query import Query
from django.utils.functional import cached_property
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

try:
Expand Down
12 changes: 8 additions & 4 deletions mypy_django_plugin/lib/helpers.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
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.checker import TypeChecker
from mypy.mro import calculate_mro
from mypy.nodes import (Block, ClassDef, Expression, GDEF, MDEF, MemberExpr, MypyFile, NameExpr, StrExpr, SymbolNode,
SymbolTable, SymbolTableNode, TypeInfo, Var)
from mypy.nodes import (
GDEF, MDEF, Block, ClassDef, Expression, MemberExpr, MypyFile, NameExpr, StrExpr, SymbolNode, SymbolTable,
SymbolTableNode, TypeInfo, Var,
)
from mypy.plugin import (
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

Expand Down
4 changes: 3 additions & 1 deletion mypy_django_plugin/transformers/querysets.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
from django.db.models.fields.related import RelatedField
from mypy.nodes import Expression, NameExpr
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.lib import fullnames, helpers
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ skip =
include_trailing_comma = true
multi_line_output = 5
wrap_length = 120
known_first_party = mypy_django_plugin

[flake8]
exclude =
Expand Down

0 comments on commit afcd0d9

Please sign in to comment.