MCPcopy Create free account
hub / github.com/driangle/taskmd / buildMultiTaskMessage

Function buildMultiTaskMessage

apps/cli/internal/cli/commit_msg.go:150–179  ·  view source on GitHub ↗
(tasks []*model.Task, commitType string, includeBody, short bool)

Source from the content-addressed store, hash-verified

148}
149
150func 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
181func formatSubjectLine(task *model.Task, commitType string) string {
182 title := lowerFirst(task.Title)

Callers 1

buildCommitMessageFunction · 0.85

Calls 2

extractCompletedSubtasksFunction · 0.85
formatSubtaskBulletsFunction · 0.85

Tested by

no test coverage detected