mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-15 16:27:09 +08:00
lint fixes
This commit is contained in:
@@ -2,7 +2,9 @@ from typing import Optional, Tuple, cast
|
||||
|
||||
from mypy.nodes import MypyFile, TypeInfo
|
||||
from mypy.plugin import FunctionContext
|
||||
from mypy.types import AnyType, CallableType, Instance, Type as MypyType, TypeOfAny
|
||||
from mypy.types import AnyType, CallableType, 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
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
from typing import Optional
|
||||
|
||||
from mypy.plugin import ClassDefContext, MethodContext
|
||||
from mypy.types import CallableType, Instance, NoneTyp, Type as MypyType, TypeType
|
||||
from mypy.types import CallableType, Instance, NoneTyp
|
||||
from mypy.types import Type as MypyType
|
||||
from mypy.types import TypeType
|
||||
|
||||
from mypy_django_plugin.lib import helpers
|
||||
|
||||
|
||||
@@ -2,12 +2,14 @@ from typing import List, Tuple, Type, Union
|
||||
|
||||
from django.db.models.base import Model
|
||||
from mypy.plugin import FunctionContext, MethodContext
|
||||
from mypy.types import Instance, Type as MypyType
|
||||
from mypy.types import Instance
|
||||
from mypy.types import Type as MypyType
|
||||
|
||||
from mypy_django_plugin.django.context import DjangoContext
|
||||
|
||||
|
||||
def get_actual_types(ctx: Union[MethodContext, FunctionContext], expected_keys: List[str]) -> List[Tuple[str, MypyType]]:
|
||||
def get_actual_types(ctx: Union[MethodContext, FunctionContext],
|
||||
expected_keys: List[str]) -> List[Tuple[str, MypyType]]:
|
||||
actual_types = []
|
||||
# positionals
|
||||
for pos, (actual_name, actual_type) in enumerate(zip(ctx.arg_names[0], ctx.arg_types[0])):
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from django.core.exceptions import FieldDoesNotExist
|
||||
from mypy.plugin import MethodContext
|
||||
from mypy.types import AnyType, Type as MypyType, TypeOfAny, Instance
|
||||
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
|
||||
|
||||
@@ -2,15 +2,19 @@ from collections import OrderedDict
|
||||
from typing import Type, cast
|
||||
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields import DateField, DateTimeField
|
||||
from django.db.models.fields.related import ForeignKey
|
||||
from django.db.models.fields.reverse_related import ManyToManyRel, ManyToOneRel, OneToOneRel
|
||||
from django.db.models.fields.reverse_related import (
|
||||
ManyToManyRel, ManyToOneRel, OneToOneRel,
|
||||
)
|
||||
from mypy.newsemanal.semanal import NewSemanticAnalyzer
|
||||
from mypy.nodes import ARG_STAR2, Argument, MDEF, SymbolTableNode, TypeInfo, Var
|
||||
from mypy.nodes import (
|
||||
ARG_STAR2, MDEF, Argument, SymbolTableNode, TypeInfo, Var,
|
||||
)
|
||||
from mypy.plugin import ClassDefContext
|
||||
from mypy.plugins import common
|
||||
from mypy.types import AnyType, Instance, TypeOfAny
|
||||
|
||||
from django.db.models.fields import DateField, DateTimeField
|
||||
from mypy_django_plugin.django.context import DjangoContext
|
||||
from mypy_django_plugin.lib import fullnames, helpers
|
||||
from mypy_django_plugin.transformers import fields
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
from collections import OrderedDict
|
||||
from typing import List, Optional, Sequence, Tuple, Type, Union, cast
|
||||
from typing import List, Optional, Sequence, Tuple, Type, Union
|
||||
|
||||
from django.core.exceptions import FieldError
|
||||
from django.db.models.base import Model
|
||||
from mypy.checker import TypeChecker
|
||||
from mypy.nodes import Expression, NameExpr
|
||||
from mypy.plugin import AnalyzeTypeContext, 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
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from mypy.plugin import AttributeContext
|
||||
from mypy.types import Instance, Type as MypyType
|
||||
from mypy.types import Instance
|
||||
from mypy.types import Type as MypyType
|
||||
|
||||
from mypy_django_plugin.django.context import DjangoContext
|
||||
from mypy_django_plugin.lib import helpers
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from mypy.nodes import TypeInfo, MemberExpr
|
||||
from mypy.plugin import FunctionContext, AttributeContext
|
||||
from mypy.types import Type as MypyType, TypeType, Instance
|
||||
from mypy.nodes import MemberExpr, TypeInfo
|
||||
from mypy.plugin import AttributeContext, FunctionContext
|
||||
from mypy.types import Instance
|
||||
from mypy.types import Type as MypyType
|
||||
from mypy.types import TypeType
|
||||
|
||||
from mypy_django_plugin.django.context import DjangoContext
|
||||
from mypy_django_plugin.lib import helpers
|
||||
@@ -42,4 +44,3 @@ def get_type_of_settings_attribute(ctx: AttributeContext, django_context: Django
|
||||
return ctx.default_attr_type
|
||||
|
||||
return Instance(value_info, [])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user