Group loop_claude's modules into claude_code, claude_runs and project, and move the findings document beside larv-review
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import json
|
||||
import sys
|
||||
|
||||
from loop_claude.claude_code.formats import mark_trusted, trust_records
|
||||
from loop_claude.file_writes import replace_json
|
||||
from loop_claude.outcome import Failure
|
||||
|
||||
|
||||
def trust(config, roots):
|
||||
try:
|
||||
with open(config, encoding="utf-8") as handle:
|
||||
data = json.load(handle)
|
||||
except (OSError, ValueError) as failure:
|
||||
print(f"could not read {config}: {getattr(failure, 'strerror', failure)}", file=sys.stderr)
|
||||
return
|
||||
projects = trust_records(data)
|
||||
if isinstance(projects, Failure):
|
||||
print(f"could not read {config}: {projects.reason}", file=sys.stderr)
|
||||
return
|
||||
untrusted = mark_trusted(projects, roots)
|
||||
if not untrusted:
|
||||
return
|
||||
if failure := replace_json(config, data, indent=2):
|
||||
print(f"could not write {config}: {failure.reason}", file=sys.stderr)
|
||||
return
|
||||
print("trusted for the interrupt: " + ", ".join(untrusted), file=sys.stderr)
|
||||
Reference in New Issue
Block a user