mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-16 03:49:26 +00:00
fix(independent): lint in the evaluation runner (committed past a failing check)
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01EmM1j46qgKMh3zqD1QMwEo
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
13180a11db
commit
ebcc2cf7fd
@@ -102,7 +102,9 @@ def run(args: argparse.Namespace) -> int:
|
|||||||
else:
|
else:
|
||||||
out.write_text(json.dumps({"instrument_error": result["instrument_error"], "questions": 0, "findings": []}) + "\n")
|
out.write_text(json.dumps({"instrument_error": result["instrument_error"], "questions": 0, "findings": []}) + "\n")
|
||||||
summary = json.loads(out.read_text())
|
summary = json.loads(out.read_text())
|
||||||
print(json.dumps({"case": case["id"], "pin": label, "questions": summary.get("questions"), "completed": summary.get("completed"), "findings": len(summary.get("findings", [])), "seconds": summary.get("seconds")}), flush=True) # fmt: skip
|
keys = ("questions", "completed", "seconds")
|
||||||
|
progress = {"case": case["id"], "pin": label, "findings": len(summary.get("findings", [])), **{k: summary.get(k) for k in keys}}
|
||||||
|
print(json.dumps(progress), flush=True)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
@@ -114,9 +116,7 @@ def hunks(case: dict, side: str) -> dict[str, list[tuple[int, int]]]:
|
|||||||
ranges: dict[str, list[tuple[int, int]]] = {}
|
ranges: dict[str, list[tuple[int, int]]] = {}
|
||||||
current = ""
|
current = ""
|
||||||
for line in diff.splitlines():
|
for line in diff.splitlines():
|
||||||
if line.startswith("--- a/") and side == "old":
|
if (line.startswith("--- a/") and side == "old") or (line.startswith("+++ b/") and side == "new"):
|
||||||
current = line[6:]
|
|
||||||
elif line.startswith("+++ b/") and side == "new":
|
|
||||||
current = line[6:]
|
current = line[6:]
|
||||||
elif line.startswith("@@") and current:
|
elif line.startswith("@@") and current:
|
||||||
match = re.search(r"-(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))?", line)
|
match = re.search(r"-(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))?", line)
|
||||||
|
|||||||
Reference in New Issue
Block a user