diff options
| author | Claude <noreply@anthropic.com> | 2026-11-11 17:18:21 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-11-11 17:18:21 +0000 |
| commit | 28015cec9482d9fd0f398002c5fbf86e384ed862 (patch) | |
| tree | a2b1bf45825a6966fcc11d53e8440394b9086822 /.github/scripts/sg_platform_annotate.py | |
| parent | 477cb53104a8ae222ca0964ec2ca8cdac42184a7 (diff) | |
scratch: platform tests for the combined treemhegazy/sg2020model
Co-authored-by: mhegazy <mhegazy@anthropic.com>
Diffstat (limited to '.github/scripts/sg_platform_annotate.py')
| -rw-r--r-- | .github/scripts/sg_platform_annotate.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/.github/scripts/sg_platform_annotate.py b/.github/scripts/sg_platform_annotate.py new file mode 100644 index 00000000..e8567d81 --- /dev/null +++ b/.github/scripts/sg_platform_annotate.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +"""Print ten chunks of a text file as notice annotations, starting at chunk N.""" +import sys + +CHUNK = 3600 # an annotation keeps 4096 bytes +lines = open(sys.argv[1], encoding="utf-8", errors="replace").read().splitlines() +chunks, current = [], "" +for line in lines: + if current and len((current + line).encode("utf-8")) + 1 > CHUNK: + chunks.append(current) + current = "" + current += line[:CHUNK] + "\n" +if current: + chunks.append(current) +first = int(sys.argv[2]) +for index in range(first, min(first + 10, len(chunks))): + body = chunks[index].replace("%", "%25").replace("\r", "%0D").replace("\n", "%0A") + print("::notice title=report %03d of %03d::%s" % (index + 1, len(chunks), body)) +if first == 0: + print("%d chunks, %d characters" % (len(chunks), sum(map(len, chunks)))) |
