Annotate the return type of every function in loop_claude

This commit is contained in:
2026-09-29 12:23:37 +02:00
parent 0842135b87
commit d13658967a
20 changed files with 62 additions and 58 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ import pathlib
from loop_claude.outcome import Stop
def read_premises(root):
def read_premises(root) -> str | Stop:
try:
found = sections(pathlib.Path(root, "README.md").read_text(encoding="utf-8"))
except OSError as failure:
@@ -22,7 +22,7 @@ def read_premises(root):
return f"## Goals\n{found['Goals'][0]}\n\n## Audience\n{found['Audience'][0]}"
def sections(text):
def sections(text) -> dict[str, list[str]]:
blocks, fenced = [], False
for line in text.splitlines():
fenced ^= line.startswith("```")