(tasks []*model.Task, commitType string, includeBody, short bool)
| 148 | } |
| 149 | |
| 150 | func buildMultiTaskMessage(tasks []*model.Task, commitType string, includeBody, short bool) string { |
| 151 | ids := make([]string, len(tasks)) |
| 152 | for i, t := range tasks { |
| 153 | ids[i] = t.ID |
| 154 | } |
| 155 | |
| 156 | subject := fmt.Sprintf("%s: complete tasks %s", commitType, strings.Join(ids, ", ")) |
| 157 | if short { |
| 158 | return subject + "\n" |
| 159 | } |
| 160 | |
| 161 | var parts []string |
| 162 | parts = append(parts, subject) |
| 163 | |
| 164 | if includeBody { |
| 165 | var bodyParts []string |
| 166 | for _, t := range tasks { |
| 167 | subtasks := extractCompletedSubtasks(t.Body) |
| 168 | if len(subtasks) > 0 { |
| 169 | section := fmt.Sprintf("%s:\n%s", t.Title, formatSubtaskBullets(subtasks)) |
| 170 | bodyParts = append(bodyParts, section) |
| 171 | } |
| 172 | } |
| 173 | if len(bodyParts) > 0 { |
| 174 | parts = append(parts, strings.Join(bodyParts, "\n\n")) |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | return strings.Join(parts, "\n\n") + "\n" |
| 179 | } |
| 180 | |
| 181 | func formatSubjectLine(task *model.Task, commitType string) string { |
| 182 | title := lowerFirst(task.Title) |
no test coverage detected