Adds more rules to mypy config, related #662 (#663)

* Adds more rules to mypy config, related #662

* Removes plugin.ini for mypy settings

* Fixes build
This commit is contained in:
Nikita Sobolev
2021-07-04 15:41:51 +03:00
committed by GitHub
parent d9c63f5e71
commit 552f2ffc0c
16 changed files with 35 additions and 33 deletions

View File

@@ -70,7 +70,7 @@ class PermissionsMixin(models.Model):
def has_perms(self, perm_list: Collection[str], obj: Optional[_AnyUser] = ...) -> bool: ...
def has_module_perms(self, app_label: str) -> bool: ...
class AbstractUser(AbstractBaseUser, PermissionsMixin): # type: ignore
class AbstractUser(AbstractBaseUser, PermissionsMixin):
username_validator: UnicodeUsernameValidator = ...
username = models.CharField(max_length=150)

View File

@@ -2,7 +2,7 @@ from typing import Any
from django.db import models
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange # type: ignore
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange
class RangeField(models.Field):
empty_strings_allowed: bool = ...

View File

@@ -1,3 +1,3 @@
from django.core.management.commands.runserver import Command as RunserverCommand # type: ignore
from django.core.management.commands.runserver import Command as RunserverCommand
class Command(RunserverCommand): ...

View File

@@ -1,4 +1,4 @@
from email._policybase import Policy # type: ignore
from email._policybase import Policy
from email.message import Message
from email.mime.base import MIMEBase
from email.mime.message import MIMEMessage

View File

@@ -1,6 +1,6 @@
from django.core.serializers import base as base
from typing import Any
from xml.sax.expatreader import ExpatParser as _ExpatParser # type: ignore
from xml.sax.expatreader import ExpatParser as _ExpatParser
class Serializer(base.Serializer):
def indent(self, level: Any) -> None: ...

View File

@@ -1,7 +1,7 @@
import types
from datetime import date, datetime, time
from decimal import Decimal
from typing import Any, ContextManager, Dict, List, Mapping, Optional, Sequence, Tuple, Type, Union
from typing import Any, ContextManager, Dict, List, Mapping, Optional, Sequence, Tuple, Type, Union, Iterator
from uuid import UUID
logger: Any

View File

@@ -94,16 +94,16 @@ class Client(RequestFactory):
def request(self, **request: Any) -> HttpResponse: ... # type: ignore
def get( # type: ignore
self, path: str, data: Any = ..., follow: bool = ..., secure: bool = ..., **extra: Any
) -> HttpResponse: ... # type: ignore
) -> HttpResponse: ...
def post( # type: ignore
self, path: str, data: Any = ..., content_type: str = ..., follow: bool = ..., secure: bool = ..., **extra: Any
) -> HttpResponse: ... # type: ignore
) -> HttpResponse: ...
def head( # type: ignore
self, path: str, data: Any = ..., follow: bool = ..., secure: bool = ..., **extra: Any
) -> HttpResponse: ... # type: ignore
) -> HttpResponse: ...
def trace( # type: ignore
self, path: str, follow: bool = ..., secure: bool = ..., **extra: Any
) -> HttpResponse: ... # type: ignore
) -> HttpResponse: ...
def options( # type: ignore
self,
path: str,
@@ -112,16 +112,16 @@ class Client(RequestFactory):
follow: bool = ...,
secure: bool = ...,
**extra: Any
) -> HttpResponse: ... # type: ignore
) -> HttpResponse: ...
def put( # type: ignore
self, path: str, data: Any = ..., content_type: str = ..., follow: bool = ..., secure: bool = ..., **extra: Any
) -> HttpResponse: ... # type: ignore
) -> HttpResponse: ...
def patch( # type: ignore
self, path: str, data: Any = ..., content_type: str = ..., follow: bool = ..., secure: bool = ..., **extra: Any
) -> HttpResponse: ... # type: ignore
) -> HttpResponse: ...
def delete( # type: ignore
self, path: str, data: Any = ..., content_type: str = ..., follow: bool = ..., secure: bool = ..., **extra: Any
) -> HttpResponse: ... # type: ignore
) -> HttpResponse: ...
def store_exc_info(self, **kwargs: Any) -> None: ...
@property
def session(self) -> SessionBase: ...