(opts reviewOptions)
| 23 | ) |
| 24 | |
| 25 | func validateAnalysisOptions(opts reviewOptions) error { |
| 26 | if opts.analysisMaxTokensBudget < 0 { |
| 27 | return fmt.Errorf("--analysis-max-tokens-budget must be a non-negative integer (0 means unlimited)") |
| 28 | } |
| 29 | if !opts.analysis { |
| 30 | return nil |
| 31 | } |
| 32 | if opts.resume != "" || opts.preview { |
| 33 | return fmt.Errorf("--analysis cannot be combined with --resume or --preview") |
| 34 | } |
| 35 | if reviewModeFromOptions(opts) == session.ReviewModeWorkspace { |
| 36 | return fmt.Errorf("--analysis is not available in workspace mode; omit --analysis to review uncommitted changes, or use --commit <sha> or --from <base> [--to <head>] to analyze committed changes") |
| 37 | } |
| 38 | format := strings.ToLower(strings.TrimSpace(opts.outputFormat)) |
| 39 | if format != "text" && format != "json" { |
| 40 | return fmt.Errorf("--analysis supports only --format text or json") |
| 41 | } |
| 42 | return nil |
| 43 | } |
| 44 | |
| 45 | type analysisRequest struct { |
| 46 | input behaviortask.Input |
no test coverage detected