(preview *agent.DiffPreview, reviewable bool)
| 290 | } |
| 291 | |
| 292 | func previewFiles(preview *agent.DiffPreview, reviewable bool) []delegatePreviewFileJSON { |
| 293 | files := make([]delegatePreviewFileJSON, 0) |
| 294 | for _, entry := range preview.Entries { |
| 295 | if entry.WillReview != reviewable { |
| 296 | continue |
| 297 | } |
| 298 | files = append(files, delegatePreviewFileJSON{ |
| 299 | Path: entry.Path, |
| 300 | Status: entry.Status, |
| 301 | Insertions: entry.Insertions, |
| 302 | Deletions: entry.Deletions, |
| 303 | ExcludeReason: string(entry.ExcludeReason), |
| 304 | }) |
| 305 | } |
| 306 | return files |
| 307 | } |
| 308 | |
| 309 | func ruleGroupsJSON(groups []delegate.RuleGroup) []delegateRuleGroupJSON { |
| 310 | out := make([]delegateRuleGroupJSON, 0, len(groups)) |
no outgoing calls
no test coverage detected