From 4a2234751f000f2d0a11e73630fb1895d531d423 Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Fri, 13 Oct 2023 20:49:27 +0000 Subject: [PATCH] chore(internal): enable lint rule --- pyproject.toml | 2 ++ src/finch/_base_client.py | 13 ++++++++++--- src/finch/_compat.py | 14 +++++++------- src/finch/_exceptions.py | 2 +- src/finch/pagination.py | 4 ++-- tests/test_models.py | 2 +- 6 files changed, 23 insertions(+), 14 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b3c0b746..78b2279d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -81,6 +81,8 @@ select = [ "F401", # bare except statements "E722", + # unused arguments + "ARG", # print statements "T201", "T203", diff --git a/src/finch/_base_client.py b/src/finch/_base_client.py index eb5efec2..dd037716 100644 --- a/src/finch/_base_client.py +++ b/src/finch/_base_client.py @@ -405,7 +405,10 @@ def _build_headers(self, options: FinalRequestOptions) -> httpx.Headers: return headers - def _prepare_request(self, request: httpx.Request) -> None: + def _prepare_request( + self, + request: httpx.Request, # noqa: ARG002 + ) -> None: """This method is used as a callback for mutating the `Request` object after it has been constructed. @@ -509,7 +512,7 @@ def _process_response( self, *, cast_to: Type[ResponseT], - options: FinalRequestOptions, + options: FinalRequestOptions, # noqa: ARG002 response: httpx.Response, ) -> ResponseT: if cast_to is NoneType: @@ -616,7 +619,11 @@ def default_headers(self) -> dict[str, str | Omit]: **self._custom_headers, } - def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None: + def _validate_headers( + self, + headers: Headers, # noqa: ARG002 + custom_headers: Headers, # noqa: ARG002 + ) -> None: """Validate the given default headers and custom headers. Does nothing by default. diff --git a/src/finch/_compat.py b/src/finch/_compat.py index 5a7ce61b..34323c9b 100644 --- a/src/finch/_compat.py +++ b/src/finch/_compat.py @@ -20,25 +20,25 @@ # v1 re-exports if TYPE_CHECKING: - def parse_date(value: date | StrBytesIntFloat) -> date: + def parse_date(value: date | StrBytesIntFloat) -> date: # noqa: ARG001 ... - def parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime: + def parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime: # noqa: ARG001 ... - def get_args(t: type[Any]) -> tuple[Any, ...]: + def get_args(t: type[Any]) -> tuple[Any, ...]: # noqa: ARG001 ... - def is_union(tp: type[Any] | None) -> bool: + def is_union(tp: type[Any] | None) -> bool: # noqa: ARG001 ... - def get_origin(t: type[Any]) -> type[Any] | None: + def get_origin(t: type[Any]) -> type[Any] | None: # noqa: ARG001 ... - def is_literal_type(type_: type[Any]) -> bool: + def is_literal_type(type_: type[Any]) -> bool: # noqa: ARG001 ... - def is_typeddict(type_: type[Any]) -> bool: + def is_typeddict(type_: type[Any]) -> bool: # noqa: ARG001 ... else: diff --git a/src/finch/_exceptions.py b/src/finch/_exceptions.py index 4b1e0a1d..53277adc 100644 --- a/src/finch/_exceptions.py +++ b/src/finch/_exceptions.py @@ -37,7 +37,7 @@ class APIError(FinchError): If there was no response associated with this error then it will be `None`. """ - def __init__(self, message: str, request: httpx.Request, *, body: object | None) -> None: + def __init__(self, message: str, request: httpx.Request, *, body: object | None) -> None: # noqa: ARG002 super().__init__(message) self.request = request self.message = message diff --git a/src/finch/pagination.py b/src/finch/pagination.py index 688366a1..dc050d24 100644 --- a/src/finch/pagination.py +++ b/src/finch/pagination.py @@ -36,7 +36,7 @@ def next_page_info(self) -> None: return None @classmethod - def build(cls: Type[_BaseModelT], *, response: Response, data: object) -> _BaseModelT: + def build(cls: Type[_BaseModelT], *, response: Response, data: object) -> _BaseModelT: # noqa: ARG003 return cls.construct( **{ **(cast(Mapping[str, Any], data) if is_mapping(data) else {"items": data}), @@ -58,7 +58,7 @@ def next_page_info(self) -> None: return None @classmethod - def build(cls: Type[_BaseModelT], *, response: Response, data: object) -> _BaseModelT: + def build(cls: Type[_BaseModelT], *, response: Response, data: object) -> _BaseModelT: # noqa: ARG003 return cls.construct( **{ **(cast(Mapping[str, Any], data) if is_mapping(data) else {"items": data}), diff --git a/tests/test_models.py b/tests/test_models.py index fa5ddba7..e9d5cac4 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -553,7 +553,7 @@ class Model(BaseModel): def test_type_compat() -> None: # our model type can be assigned to Pydantic's model type - def takes_pydantic(model: pydantic.BaseModel) -> None: + def takes_pydantic(model: pydantic.BaseModel) -> None: # noqa: ARG001 ... class OurModel(BaseModel):