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

Function validateScanOptions

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

Source from the content-addressed store, hash-verified

133}
134
135func validateScanOptions(opts *scanOptions) error {
136 if err := validateAudience(opts.audience); err != nil {
137 return err
138 }
139 if opts.maxTools < 0 {
140 return fmt.Errorf("--max-tools must be a non-negative integer (0 means use template default)")
141 }
142 if opts.maxGitProcs < 0 {
143 return fmt.Errorf("--max-git-procs must be a non-negative integer (0 means use default 16)")
144 }
145 if opts.maxTokens < 0 {
146 return fmt.Errorf("--max-tokens must be a non-negative integer (0 means use configured or template default)")
147 }
148 if opts.preview && opts.resume != "" {
149 return fmt.Errorf("--preview and --resume cannot be used together")
150 }
151 if opts.maxTokensBudget < 0 {
152 return fmt.Errorf("--max-tokens-budget must be a non-negative integer (0 means unlimited)")
153 }
154 return nil
155}
156
157func validateDelegateOptions(opts *delegateOptions) error {
158 if err := validateDiffMode(opts.from, opts.to, opts.commit); err != nil {

Callers 2

parseScanFlagsFunction · 0.85
scan_cmd.goFile · 0.85

Calls 1

validateAudienceFunction · 0.85

Tested by 1

parseScanFlagsFunction · 0.68