From 7aa66893c7820bee2f7da719bf17d98cbad802fc Mon Sep 17 00:00:00 2001 From: Noelle Leigh <5957867+noelleleigh@users.noreply.github.com> Date: Tue, 31 Oct 2023 12:47:58 -0400 Subject: [PATCH] ./s/lint results --- django-stubs/db/models/functions/comparison.pyi | 2 ++ django-stubs/db/models/manager.pyi | 4 +++- django-stubs/http/request.pyi | 5 ++--- django-stubs/http/response.pyi | 2 +- django-stubs/test/testcases.pyi | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/django-stubs/db/models/functions/comparison.pyi b/django-stubs/db/models/functions/comparison.pyi index 58247e38f..68f287b49 100644 --- a/django-stubs/db/models/functions/comparison.pyi +++ b/django-stubs/db/models/functions/comparison.pyi @@ -9,10 +9,12 @@ class Cast(Func): ) -> None: ... class Coalesce(Func): ... + class Collate(Func): def __init__(self, expression: Any, collation: str) -> None: ... class Greatest(Func): ... + class JSONObject(Func): def __init__(self, **fields: Any) -> None: ... diff --git a/django-stubs/db/models/manager.pyi b/django-stubs/db/models/manager.pyi index 3ed250aaa..7dc395065 100644 --- a/django-stubs/db/models/manager.pyi +++ b/django-stubs/db/models/manager.pyi @@ -19,7 +19,9 @@ class BaseManager(QuerySet[_T]): def __init__(self) -> None: ... def deconstruct( self, - ) -> tuple[bool, str | None, str | None, tuple[Any, ...] | None, dict[str, Any] | None]: ... + ) -> tuple[ + bool, str | None, str | None, tuple[Any, ...] | None, dict[str, Any] | None + ]: ... def check(self, **kwargs: Any) -> list[Any]: ... @classmethod def from_queryset( diff --git a/django-stubs/http/request.pyi b/django-stubs/http/request.pyi index e6cefb69f..19211e86e 100644 --- a/django-stubs/http/request.pyi +++ b/django-stubs/http/request.pyi @@ -1,5 +1,4 @@ from collections.abc import Iterable, Mapping -from io import BytesIO from re import Pattern from typing import Any, BinaryIO, TypeVar, overload from typing_extensions import Self @@ -92,8 +91,8 @@ class HttpRequest: def body(self) -> bytes: ... def _load_post_and_files(self) -> None: ... def close(self) -> None: ... - def read(self, *args, **kwargs) -> bytes: ... - def readline(self, *args, **kwargs) -> bytes: ... + def read(self, *args: Any, **kwargs: Any) -> bytes: ... + def readline(self, *args: Any, **kwargs: Any) -> bytes: ... def __iter__(self) -> Iterable[bytes]: ... def readlines(self) -> list[bytes]: ... diff --git a/django-stubs/http/response.pyi b/django-stubs/http/response.pyi index db6c5f830..4d23ab4e1 100644 --- a/django-stubs/http/response.pyi +++ b/django-stubs/http/response.pyi @@ -3,6 +3,7 @@ from collections.abc import AsyncIterable, AsyncIterator, Iterable, Iterator from io import BytesIO from json import JSONEncoder from typing import Any, overload +from typing_extensions import Never from django.core.handlers.wsgi import WSGIRequest from django.http.cookie import SimpleCookie @@ -10,7 +11,6 @@ from django.template import Context, Template from django.test.client import Client from django.urls import ResolverMatch from django.utils.datastructures import CaseInsensitiveMapping -from typing_extensions import Never class ResponseHeaders(CaseInsensitiveMapping[str]): def pop(self, key: str, default: str | None = ...) -> str: ... diff --git a/django-stubs/test/testcases.pyi b/django-stubs/test/testcases.pyi index 583cb1401..89e2b7463 100644 --- a/django-stubs/test/testcases.pyi +++ b/django-stubs/test/testcases.pyi @@ -9,7 +9,7 @@ from django.core.servers.basehttp import ThreadedWSGIServer, WSGIRequestHandler from django.db import connections as connections # noqa: F401 from django.db.backends.sqlite3.base import DatabaseWrapper from django.db.models import Model -from django.db.models.query import _BaseQuerySet, ValuesQuerySet +from django.db.models.query import ValuesQuerySet, _BaseQuerySet from django.forms.fields import EmailField from django.http.response import HttpResponse, HttpResponseBase from django.template.base import Template