Skip to content

Commit 8e266e8

Browse files
chore(internal): enable lint rule (#132)
1 parent 20aa00a commit 8e266e8

File tree

6 files changed

+23
-14
lines changed

6 files changed

+23
-14
lines changed

pyproject.toml

+2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ select = [
8181
"F401",
8282
# bare except statements
8383
"E722",
84+
# unused arguments
85+
"ARG",
8486
# print statements
8587
"T201",
8688
"T203",

src/finch/_base_client.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,10 @@ def _build_headers(self, options: FinalRequestOptions) -> httpx.Headers:
405405

406406
return headers
407407

408-
def _prepare_request(self, request: httpx.Request) -> None:
408+
def _prepare_request(
409+
self,
410+
request: httpx.Request, # noqa: ARG002
411+
) -> None:
409412
"""This method is used as a callback for mutating the `Request` object
410413
after it has been constructed.
411414
@@ -509,7 +512,7 @@ def _process_response(
509512
self,
510513
*,
511514
cast_to: Type[ResponseT],
512-
options: FinalRequestOptions,
515+
options: FinalRequestOptions, # noqa: ARG002
513516
response: httpx.Response,
514517
) -> ResponseT:
515518
if cast_to is NoneType:
@@ -616,7 +619,11 @@ def default_headers(self) -> dict[str, str | Omit]:
616619
**self._custom_headers,
617620
}
618621

619-
def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None:
622+
def _validate_headers(
623+
self,
624+
headers: Headers, # noqa: ARG002
625+
custom_headers: Headers, # noqa: ARG002
626+
) -> None:
620627
"""Validate the given default headers and custom headers.
621628
622629
Does nothing by default.

src/finch/_compat.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,25 @@
2020
# v1 re-exports
2121
if TYPE_CHECKING:
2222

23-
def parse_date(value: date | StrBytesIntFloat) -> date:
23+
def parse_date(value: date | StrBytesIntFloat) -> date: # noqa: ARG001
2424
...
2525

26-
def parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime:
26+
def parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime: # noqa: ARG001
2727
...
2828

29-
def get_args(t: type[Any]) -> tuple[Any, ...]:
29+
def get_args(t: type[Any]) -> tuple[Any, ...]: # noqa: ARG001
3030
...
3131

32-
def is_union(tp: type[Any] | None) -> bool:
32+
def is_union(tp: type[Any] | None) -> bool: # noqa: ARG001
3333
...
3434

35-
def get_origin(t: type[Any]) -> type[Any] | None:
35+
def get_origin(t: type[Any]) -> type[Any] | None: # noqa: ARG001
3636
...
3737

38-
def is_literal_type(type_: type[Any]) -> bool:
38+
def is_literal_type(type_: type[Any]) -> bool: # noqa: ARG001
3939
...
4040

41-
def is_typeddict(type_: type[Any]) -> bool:
41+
def is_typeddict(type_: type[Any]) -> bool: # noqa: ARG001
4242
...
4343

4444
else:

src/finch/_exceptions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class APIError(FinchError):
3737
If there was no response associated with this error then it will be `None`.
3838
"""
3939

40-
def __init__(self, message: str, request: httpx.Request, *, body: object | None) -> None:
40+
def __init__(self, message: str, request: httpx.Request, *, body: object | None) -> None: # noqa: ARG002
4141
super().__init__(message)
4242
self.request = request
4343
self.message = message

src/finch/pagination.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def next_page_info(self) -> None:
3636
return None
3737

3838
@classmethod
39-
def build(cls: Type[_BaseModelT], *, response: Response, data: object) -> _BaseModelT:
39+
def build(cls: Type[_BaseModelT], *, response: Response, data: object) -> _BaseModelT: # noqa: ARG003
4040
return cls.construct(
4141
**{
4242
**(cast(Mapping[str, Any], data) if is_mapping(data) else {"items": data}),
@@ -58,7 +58,7 @@ def next_page_info(self) -> None:
5858
return None
5959

6060
@classmethod
61-
def build(cls: Type[_BaseModelT], *, response: Response, data: object) -> _BaseModelT:
61+
def build(cls: Type[_BaseModelT], *, response: Response, data: object) -> _BaseModelT: # noqa: ARG003
6262
return cls.construct(
6363
**{
6464
**(cast(Mapping[str, Any], data) if is_mapping(data) else {"items": data}),

tests/test_models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ class Model(BaseModel):
553553
def test_type_compat() -> None:
554554
# our model type can be assigned to Pydantic's model type
555555

556-
def takes_pydantic(model: pydantic.BaseModel) -> None:
556+
def takes_pydantic(model: pydantic.BaseModel) -> None: # noqa: ARG001
557557
...
558558

559559
class OurModel(BaseModel):

0 commit comments

Comments
 (0)