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

Function validateScanOptions

cmd/opencodereview/shared_flags.go:124–138  ·  view source on GitHub ↗
(opts *scanOptions)

Source from the content-addressed store, hash-verified

122}
123
124func validateScanOptions(opts *scanOptions) error {
125 if err := validateAudience(opts.audience); err != nil {
126 return err
127 }
128 if opts.maxTools < 0 {
129 return fmt.Errorf("--max-tools must be a non-negative integer (0 means use template default)")
130 }
131 if opts.maxGitProcs < 0 {
132 return fmt.Errorf("--max-git-procs must be a non-negative integer (0 means use default 16)")
133 }
134 if opts.maxTokensBudget < 0 {
135 return fmt.Errorf("--max-tokens-budget must be a non-negative integer (0 means unlimited)")
136 }
137 return nil
138}
139
140func validateDelegateOptions(opts *delegateOptions) error {
141 return validateDiffMode(opts.from, opts.to, opts.commit)

Callers 2

parseScanFlagsFunction · 0.85
scan_cmd.goFile · 0.85

Calls 1

validateAudienceFunction · 0.85

Tested by 1

parseScanFlagsFunction · 0.68