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

Function validateOutputFormat

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

Source from the content-addressed store, hash-verified

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

Callers 2

validateReviewOptionsFunction · 0.85
validateScanOptionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected