(ownerEvaluation *codeowners.Evaluation)
| 58 | } |
| 59 | |
| 60 | func mapCodeOwnerEvaluation(ownerEvaluation *codeowners.Evaluation) []types.CodeOwnerEvaluationEntry { |
| 61 | codeOwnerEvaluationEntries := make([]types.CodeOwnerEvaluationEntry, len(ownerEvaluation.EvaluationEntries)) |
| 62 | for i, entry := range ownerEvaluation.EvaluationEntries { |
| 63 | ownerEvaluations := make([]types.OwnerEvaluation, len(entry.OwnerEvaluations)) |
| 64 | userGroupOwnerEvaluations := make([]types.UserGroupOwnerEvaluation, len(entry.UserGroupOwnerEvaluations)) |
| 65 | for j, owner := range entry.OwnerEvaluations { |
| 66 | ownerEvaluations[j] = mapOwner(owner) |
| 67 | } |
| 68 | for j, userGroupOwnerEvaluation := range entry.UserGroupOwnerEvaluations { |
| 69 | userGroupEvaluations := make([]types.OwnerEvaluation, len(userGroupOwnerEvaluation.Evaluations)) |
| 70 | for k, userGroupOwner := range userGroupOwnerEvaluation.Evaluations { |
| 71 | userGroupEvaluations[k] = mapOwner(userGroupOwner) |
| 72 | } |
| 73 | userGroupOwnerEvaluations[j] = types.UserGroupOwnerEvaluation{ |
| 74 | ID: userGroupOwnerEvaluation.Identifier, |
| 75 | Name: userGroupOwnerEvaluation.Name, |
| 76 | Evaluations: userGroupEvaluations, |
| 77 | } |
| 78 | } |
| 79 | codeOwnerEvaluationEntries[i] = types.CodeOwnerEvaluationEntry{ |
| 80 | LineNumber: entry.LineNumber, |
| 81 | Pattern: entry.Pattern, |
| 82 | OwnerEvaluations: ownerEvaluations, |
| 83 | UserGroupOwnerEvaluations: userGroupOwnerEvaluations, |
| 84 | } |
| 85 | } |
| 86 | return codeOwnerEvaluationEntries |
| 87 | } |
| 88 | |
| 89 | func mapOwner(owner codeowners.OwnerEvaluation) types.OwnerEvaluation { |
| 90 | return types.OwnerEvaluation{ |
no test coverage detected
searching dependent graphs…