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
+3 -3
View File
@@ -4,7 +4,7 @@ import os
from loop_claude.outcome import Failure
def make_private(folder):
def make_private(folder) -> None:
mask = os.umask(0o077)
try:
os.makedirs(folder, exist_ok=True)
@@ -12,11 +12,11 @@ def make_private(folder):
os.umask(mask)
def replace_json(path, data, **dump):
def replace_json(path, data, **dump) -> Failure | None:
return replace_file(path, json.dumps(data, **dump).encode())
def replace_file(path, data):
def replace_file(path, data) -> Failure | None:
staged = f"{path}.{os.getpid()}"
try:
mode = os.stat(path).st_mode & 0o7777 if os.path.exists(path) else 0o600