MCPcopy Create free account
hub / github.com/FastLED/FastLED / parse_rust_json_output

Function parse_rust_json_output

ci/lint_cpp/rust_bridge.py:141–156  ·  view source on GitHub ↗

Extract the linter JSON array from soldr/cargo captured stdout.

(stdout: str | None)

Source from the content-addressed store, hash-verified

139
140
141def parse_rust_json_output(stdout: str | None) -> list[dict[str, Any]]:
142 """Extract the linter JSON array from soldr/cargo captured stdout."""
143 text = stdout or "[]"
144 decoder = json.JSONDecoder()
145
146 for index, char in enumerate(text):
147 if char != "[":
148 continue
149 try:
150 value, _end = decoder.raw_decode(text[index:])
151 except json.JSONDecodeError:
152 continue
153 if isinstance(value, list):
154 return value
155
156 raise RuntimeError("Rust C++ linter did not produce valid JSON on stdout")
157
158
159def run_rust_ab_check(

Callers 2

_rust_recordsFunction · 0.90
run_rust_linterFunction · 0.85

Calls

no outgoing calls

Tested by 1

_rust_recordsFunction · 0.72