Skip to content

Commit 7224cd6

Browse files
committed
fix: apply ruff formatting to status_pages module and test runner
Made-with: Cursor
1 parent 7b6e8f9 commit 7224cd6

2 files changed

Lines changed: 16 additions & 22 deletions

File tree

src/devhelm/resources/status_pages.py

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ def update(
5252
def delete(self, page_id: int | str, component_id: int | str) -> None:
5353
"""Remove a component from a status page."""
5454
api_delete(
55-
self._client,
56-
f"{_page_path(page_id)}/components/{path_param(component_id)}",
55+
self._client, f"{_page_path(page_id)}/components/{path_param(component_id)}"
5756
)
5857

5958
def reorder(self, page_id: int | str, body: dict[str, Any]) -> None:
@@ -91,10 +90,7 @@ def update(
9190

9291
def delete(self, page_id: int | str, group_id: int | str) -> None:
9392
"""Delete a component group."""
94-
api_delete(
95-
self._client,
96-
f"{_page_path(page_id)}/groups/{path_param(group_id)}",
97-
)
93+
api_delete(self._client, f"{_page_path(page_id)}/groups/{path_param(group_id)}")
9894

9995

10096
class _Incidents:
@@ -103,13 +99,9 @@ class _Incidents:
10399
def __init__(self, client: httpx.Client) -> None:
104100
self._client = client
105101

106-
def list(
107-
self, page_id: int | str, *, page: int = 0, size: int = 20
108-
) -> Page[Any]:
102+
def list(self, page_id: int | str, *, page: int = 0, size: int = 20) -> Page[Any]:
109103
"""List incidents on a status page (paginated)."""
110-
return fetch_page(
111-
self._client, f"{_page_path(page_id)}/incidents", page, size
112-
)
104+
return fetch_page(self._client, f"{_page_path(page_id)}/incidents", page, size)
113105

114106
def get(self, page_id: int | str, incident_id: int | str) -> Any:
115107
"""Get a single incident with timeline."""
@@ -175,8 +167,7 @@ def dismiss(self, page_id: int | str, incident_id: int | str) -> None:
175167
def delete(self, page_id: int | str, incident_id: int | str) -> None:
176168
"""Delete an incident."""
177169
api_delete(
178-
self._client,
179-
f"{_page_path(page_id)}/incidents/{path_param(incident_id)}",
170+
self._client, f"{_page_path(page_id)}/incidents/{path_param(incident_id)}"
180171
)
181172

182173

@@ -186,9 +177,7 @@ class _Subscribers:
186177
def __init__(self, client: httpx.Client) -> None:
187178
self._client = client
188179

189-
def list(
190-
self, page_id: int | str, *, page: int = 0, size: int = 20
191-
) -> Page[Any]:
180+
def list(self, page_id: int | str, *, page: int = 0, size: int = 20) -> Page[Any]:
192181
"""List confirmed subscribers (paginated)."""
193182
return fetch_page(
194183
self._client, f"{_page_path(page_id)}/subscribers", page, size
@@ -236,8 +225,7 @@ def verify(self, page_id: int | str, domain_id: int | str) -> Any:
236225
def remove(self, page_id: int | str, domain_id: int | str) -> None:
237226
"""Remove a custom domain."""
238227
api_delete(
239-
self._client,
240-
f"{_page_path(page_id)}/domains/{path_param(domain_id)}",
228+
self._client, f"{_page_path(page_id)}/domains/{path_param(domain_id)}"
241229
)
242230

243231

tests/run_sdk.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,9 @@ def run(client: Devhelm, resource: str, action: str, rest: list[str]) -> Any: #
244244
if op == "status-pages.components.create":
245245
return client.status_pages.components.create(rest[0], json.loads(rest[1]))
246246
if op == "status-pages.components.update":
247-
return client.status_pages.components.update(rest[0], rest[1], json.loads(rest[2]))
247+
return client.status_pages.components.update(
248+
rest[0], rest[1], json.loads(rest[2])
249+
)
248250
if op == "status-pages.components.delete":
249251
client.status_pages.components.delete(rest[0], rest[1])
250252
return None
@@ -271,9 +273,13 @@ def run(client: Devhelm, resource: str, action: str, rest: list[str]) -> Any: #
271273
if op == "status-pages.incidents.create":
272274
return client.status_pages.incidents.create(rest[0], json.loads(rest[1]))
273275
if op == "status-pages.incidents.update":
274-
return client.status_pages.incidents.update(rest[0], rest[1], json.loads(rest[2]))
276+
return client.status_pages.incidents.update(
277+
rest[0], rest[1], json.loads(rest[2])
278+
)
275279
if op == "status-pages.incidents.post-update":
276-
return client.status_pages.incidents.post_update(rest[0], rest[1], json.loads(rest[2]))
280+
return client.status_pages.incidents.post_update(
281+
rest[0], rest[1], json.loads(rest[2])
282+
)
277283
if op == "status-pages.incidents.publish":
278284
body = json.loads(rest[2]) if len(rest) > 2 and rest[2] else None
279285
return client.status_pages.incidents.publish(rest[0], rest[1], body)

0 commit comments

Comments
 (0)