mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-19 10:21:14 +08:00
add linting stubs with flake8-pyi and check for unused imports (#186)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import Any, List, Optional
|
||||
from typing import Any, List
|
||||
|
||||
from django.core.checks.messages import Error
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
from typing import Any, List, Optional
|
||||
from typing import Any, List
|
||||
|
||||
def check_database_backends(*args: Any, **kwargs: Any) -> List[Any]: ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, List, Optional
|
||||
from typing import Any, List
|
||||
|
||||
from django.core.checks.messages import Warning
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, List, Optional
|
||||
from typing import Any, List
|
||||
|
||||
from django.core.checks.messages import Warning
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, List, Optional
|
||||
from typing import Any, List
|
||||
|
||||
from django.core.checks.messages import Warning
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, List, Optional
|
||||
from typing import Any, List
|
||||
|
||||
from django.core.checks.messages import Error
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Callable, List, Optional, Tuple, Union
|
||||
from typing import Any, Callable, List, Tuple, Union
|
||||
|
||||
from django.core.checks.messages import CheckMessage, Error, Warning
|
||||
from django.urls.resolvers import URLPattern, URLResolver
|
||||
|
||||
@@ -8,8 +8,8 @@ from django.utils.datastructures import MultiValueDict
|
||||
class UploadFileException(Exception): ...
|
||||
|
||||
class StopUpload(UploadFileException):
|
||||
connection_reset = ... # type: bool
|
||||
def __init__(self, connection_reset: bool = False) -> None: ...
|
||||
connection_reset: bool = ...
|
||||
def __init__(self, connection_reset: bool = ...) -> None: ...
|
||||
|
||||
class SkipFile(UploadFileException): ...
|
||||
class StopFutureHandlers(UploadFileException): ...
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
from collections import Callable
|
||||
|
||||
def supports_color() -> bool: ...
|
||||
|
||||
class Style:
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
import os
|
||||
import re
|
||||
from typing import Any, Pattern, Type, Optional
|
||||
from typing import Any, Optional, Pattern, Type
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.utils.functional import cached_property
|
||||
from django.utils.jslex import prepare_js_for_gettext
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils.translation import templatize
|
||||
|
||||
plural_forms_re: Pattern = ...
|
||||
STATUS_OK: int = ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Dict, List, Optional, Union, Iterable, Sequence, Protocol, Any
|
||||
from typing import Dict, List, Optional, Protocol, Sequence, Union
|
||||
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.query import QuerySet
|
||||
|
||||
@@ -4,7 +4,7 @@ from typing import Any, Dict
|
||||
from wsgiref import simple_server
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest, WSGIHandler
|
||||
from django.core.wsgi import get_wsgi_application as get_wsgi_application
|
||||
from django.core.wsgi import get_wsgi_application as get_wsgi_application # noqa: F401
|
||||
|
||||
class WSGIServer(simple_server.WSGIServer):
|
||||
request_queue_size: int = ...
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Any, Dict, List, Optional, Type, Union, Protocol
|
||||
|
||||
from django.contrib.sessions.serializers import PickleSerializer
|
||||
from datetime import timedelta
|
||||
from typing import Any, Dict, Optional, Protocol, Type, Union
|
||||
|
||||
class BadSignature(Exception): ...
|
||||
class SignatureExpired(BadSignature): ...
|
||||
|
||||
@@ -5,7 +5,7 @@ from typing import Any, Dict, List, Optional, Union, Pattern, Collection
|
||||
from uuid import UUID
|
||||
|
||||
from django.core.files.base import File
|
||||
from django.core.exceptions import ValidationError as ValidationError
|
||||
from django.core.exceptions import ValidationError as ValidationError # noqa: F401
|
||||
|
||||
EMPTY_VALUES: Any
|
||||
|
||||
|
||||
Reference in New Issue
Block a user