MCPcopy Create free account
hub / github.com/alibaba/open-code-review / isMachineReadable

Function isMachineReadable

cmd/opencodereview/shared.go:362–369  ·  view source on GitHub ↗

isMachineReadable reports whether the output format writes a structured document to stdout that must not be interleaved with progress text. json and sarif move [ocr] progress lines off stdout and suppress the trace summary, which is already carried inside the document. html joins them for the second

(outputFormat string)

Source from the content-addressed store, hash-verified

360// source. It is not a value validateOutputFormat accepts, so it reaches this
361// function only from `session export`.
362func isMachineReadable(outputFormat string) bool {
363 switch strings.ToLower(strings.TrimSpace(outputFormat)) {
364 case "json", "sarif", "html":
365 return true
366 default:
367 return false
368 }
369}
370
371// newQuietHandle routes [ocr] progress lines away from stdout so they cannot
372// corrupt a structured output document. What it does depends on why stdout

Callers 5

newQuietHandleFunction · 0.85
resolveOutputWriterFunction · 0.85
emitRunResultFunction · 0.85
executeReviewContextFunction · 0.85
executeScanContextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected