github.com/odvcencio/gotreesitter v0.57.0
Backtick shell command-substitution syntaxBasename is uppercase README.md
SHA-25688845bba470c93fa974166e9446de68f8b926356d8848ca901f40d00a2481b07
Evidence
1## What does this PR do?
2
3<!-- One or two sentences. State the outcome, not a commit diary. -->
4
5## Why this approach?
6
7<!-- Brief rationale. Mention the main tradeoff or rejected alternative only if it matters. -->
8
9## Correctness
10
11- [ ] Focused package or unit tests ran for the touched behavior
12- [ ] Affected parity validation ran in Docker, one language or grammar at …
1#!/usr/bin/env python3
2"""Track fuzz-nightly failures as GitHub issues, one issue per fuzz target.
3
4Two subcommands:
5
6 collect Run in each fuzz matrix leg. Reads the go test log and the new
7 crasher files, then writes result.json.
8 sync Run once after the matrix. Reads every result.json and opens,
9 updates, comments on, or closes issues through the gh CLI.
10
11Rules for sync:
12 * A failing target gets one open issue titled "fuzz-nightly: <pkg>#<Target>".
13 A second fai …
20:32… >#<Target> green=<n> -->
21
22--dry-run prints the planned gh calls and reads existing issues from
23--issues-json instead of calling gh.
24"""
25import argparse
26import base64
27import json
28import os
29import re
30import subprocess
31import sys
32
33LABEL = "fuzz-nightly"
34TITLE_PREFIX = "fuzz-nightly:"
35MARKER_RE = re.compile(r"<!-- fuzz-nightly target=(\S+) green=(\d+) -->")
36MAX_FILE = 16 * 1024
37MAX_TOTAL = 48 * 1024
38CRASH_RE = re.compile(r"Failing i …
47:23… -nightly target={target} green={green} -->"
48
49
50def classify(log, exit_code):
51 """Return pass, fail, or error. Only pass and fail change issues."""
52 if exit_code == 0:
53 return "pass"
54 ret …
65:13… st prints the path relative to the package directory."""
66 if os.path.isfile(path):
67 return path
68 suffix = os.sep + os.path.normpath(path)
69 for root, dirs, names in os.walk("."):
70 dirs[:] = [d for d in dirs if d != ".git"]
71 for n in names:
⋯16 lines
88 entry["text"] = raw.decode("utf-8")
89 except UnicodeDecodeError:
90 entry["base64"] = base64.b64encode(raw).decode()
91 entry["bytes"] = len(raw)
92 files.append(entry)
⋯4 lines
Showing the top 5 files — 2 more files (38 regions) not shown.