Skip to content

Commit 39a81b9

Browse files
lesnik512claude
andcommitted
style(story-1.7): apply ruff format and drop now-unused noqa directives
Side effects of raising pylint.max-args = 10 globally: - errors.py: two existing `# noqa: PLR0913` are now redundant (function signatures with 6-7 args are under the new threshold). - test_client_response_model.py: `# ty: ignore[unknown-argument]` was defensive and turned out unused with the actual pydantic model used. Also runs ruff format on client.py and test_client_methods.py. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e0eddd1 commit 39a81b9

4 files changed

Lines changed: 6 additions & 12 deletions

File tree

src/httpware/client.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222

2323
# Recursive type alias for any JSON-serializable Python value. Used for the `json=` body parameter
2424
# on HTTP methods so we avoid `Any` while still accepting arbitrary nested structures.
25-
JsonValue: typing.TypeAlias = (
26-
Mapping[str, "JsonValue"] | Sequence["JsonValue"] | str | int | float | bool | None
27-
)
25+
JsonValue: typing.TypeAlias = Mapping[str, "JsonValue"] | Sequence["JsonValue"] | str | int | float | bool | None
2826

2927

3028
def _normalize_timeout(value: Timeout | float | None) -> Timeout:
@@ -69,9 +67,7 @@ def __init__(
6967
) -> None:
7068
normalized_timeout = _normalize_timeout(timeout)
7169
resolved_limits = limits or Limits()
72-
resolved_transport: Transport = transport or Httpx2Transport(
73-
limits=resolved_limits, timeout=normalized_timeout
74-
)
70+
resolved_transport: Transport = transport or Httpx2Transport(limits=resolved_limits, timeout=normalized_timeout)
7571
resolved_decoder = decoder or PydanticDecoder()
7672
resolved_middleware = tuple(middleware) if middleware is not None else ()
7773

src/httpware/errors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def _strip_userinfo(url: str) -> str:
3535
return urlunsplit((parts.scheme, netloc, parts.path, parts.query, parts.fragment))
3636

3737

38-
def _reconstruct_status_error( # noqa: PLR0913
38+
def _reconstruct_status_error(
3939
cls: "type[StatusError]",
4040
status: int,
4141
body: bytes,
@@ -85,7 +85,7 @@ class StatusError(ClientError):
8585
request_method: str
8686
request_url: str
8787

88-
def __init__( # noqa: PLR0913
88+
def __init__(
8989
self,
9090
*,
9191
status: int,

tests/test_client_methods.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,7 @@ async def test_post_per_call_content_type_skips_auto_injection() -> None:
146146
("options", "OPTIONS"),
147147
],
148148
)
149-
async def test_each_method_emits_correct_wire_method(
150-
client_method_name: str, expected_wire_method: str
151-
) -> None:
149+
async def test_each_method_emits_correct_wire_method(client_method_name: str, expected_wire_method: str) -> None:
152150
transport = _RecordingTransport()
153151
client = AsyncClient(transport=transport)
154152
method = getattr(client, client_method_name)

tests/test_client_response_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async def test_response_model_uses_supplied_decoder() -> None:
6363
class _SpyDecoder:
6464
def decode(self, content: bytes, model: type[T]) -> T:
6565
seen.append((content, model))
66-
return model(name="spy", qty=999) # ty: ignore[unknown-argument]
66+
return model(name="spy", qty=999)
6767

6868
client = AsyncClient(transport=transport, decoder=_SpyDecoder())
6969
result = await client.get("/foo", response_model=_Item)

0 commit comments

Comments
 (0)