Name each entry shape written_by_human checks, and annotate every parameter in loop_claude

This commit is contained in:
2026-10-01 23:47:03 +02:00
parent 70ad9a9caa
commit 39acf6dff0
24 changed files with 113 additions and 84 deletions
+5 -3
View File
@@ -1,8 +1,10 @@
import pathlib
from loop_claude.effects import Effects
from loop_claude.outcome import Stop
def checkout_root(cwd, effects: Effects) -> str | Stop:
def checkout_root(cwd: pathlib.Path, effects: Effects) -> str | Stop:
try:
found = effects.git(["rev-parse", "--show-toplevel"], str(cwd))
except OSError as failure:
@@ -12,7 +14,7 @@ def checkout_root(cwd, effects: Effects) -> str | Stop:
return found.stdout.strip()
def checkouts(root, effects: Effects) -> list[str]:
def checkouts(root: str, effects: Effects) -> list[str]:
found = [root]
try:
listing = effects.git(["worktree", "list", "--porcelain"], root)
@@ -23,5 +25,5 @@ def checkouts(root, effects: Effects) -> list[str]:
return sorted(set(found))
def project_name(root, code) -> str:
def project_name(root: str, code: pathlib.Path) -> str:
return root.removeprefix(f"{code}/").lstrip("/")