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

Function validateOutputFormat

cmd/opencodereview/shared_flags.go:112–120  ·  view source on GitHub ↗
(format string)

Source from the content-addressed store, hash-verified

110}
111
112func validateOutputFormat(format string) (string, error) {
113 normalized := strings.ToLower(strings.TrimSpace(format))
114 switch normalized {
115 case "text", "json", "sarif":
116 return normalized, nil
117 default:
118 return "", fmt.Errorf("invalid --format value %q: must be 'text', 'json', or 'sarif'", format)
119 }
120}
121
122func normalizeDiffTarget(from, to, commit string) string {
123 if from != "" && to == "" && commit == "" {

Callers 2

validateReviewOptionsFunction · 0.85
validateScanOptionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected