Skip to content

Commit 59fa698

Browse files
style: apply ruff formatter to post_hooks.py
1 parent a86fbb6 commit 59fa698

1 file changed

Lines changed: 23 additions & 9 deletions

File tree

agent/src/post_hooks.py

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -342,34 +342,48 @@ def capture_pr_screenshots(pr_url: str, task_id: str = "") -> list[str]:
342342

343343

344344
def _append_screenshots_to_pr(
345-
config: TaskConfig, setup: RepoSetup, screenshot_urls: list[str],
345+
config: TaskConfig,
346+
setup: RepoSetup,
347+
screenshot_urls: list[str],
346348
) -> None:
347349
"""Append ## Screenshots section to PR body via gh pr edit."""
348350
if not screenshot_urls:
349351
return
350352
try:
351353
result = subprocess.run(
352-
["gh", "pr", "view", setup.branch, "--repo", config.repo_url,
353-
"--json", "body", "-q", ".body"],
354+
[
355+
"gh",
356+
"pr",
357+
"view",
358+
setup.branch,
359+
"--repo",
360+
config.repo_url,
361+
"--json",
362+
"body",
363+
"-q",
364+
".body",
365+
],
354366
cwd=setup.repo_dir,
355-
capture_output=True, text=True, timeout=30,
367+
capture_output=True,
368+
text=True,
369+
timeout=30,
356370
)
357371
if result.returncode != 0:
358372
log("WARN", "Could not read PR body for screenshot append")
359373
return
360374

361375
current_body = result.stdout.strip()
362376
images_md = "\n".join(
363-
f"![Screenshot {i+1}]({url})"
364-
for i, url in enumerate(screenshot_urls)
377+
f"![Screenshot {i + 1}]({url})" for i, url in enumerate(screenshot_urls)
365378
)
366379
updated_body = f"{current_body}\n\n## Screenshots\n\n{images_md}"
367380

368381
subprocess.run(
369-
["gh", "pr", "edit", setup.branch, "--repo", config.repo_url,
370-
"--body", updated_body],
382+
["gh", "pr", "edit", setup.branch, "--repo", config.repo_url, "--body", updated_body],
371383
cwd=setup.repo_dir,
372-
capture_output=True, text=True, timeout=30,
384+
capture_output=True,
385+
text=True,
386+
timeout=30,
373387
)
374388
log("POST", f"Appended {len(screenshot_urls)} screenshot(s) to PR body")
375389
except Exception as e:

0 commit comments

Comments
 (0)