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

Method checkMissingParent

sdk/go/validator/validator.go:311–324  ·  view source on GitHub ↗

checkMissingParent checks that parent references an existing task

(tasks []*model.Task, taskMap map[string]*model.Task, result *ValidationResult)

Source from the content-addressed store, hash-verified

309
310// checkMissingParent checks that parent references an existing task
311func (v *Validator) checkMissingParent(tasks []*model.Task, taskMap map[string]*model.Task, result *ValidationResult) {
312 for _, task := range tasks {
313 if task.Parent == "" {
314 continue
315 }
316 if _, exists := taskMap[task.Parent]; !exists {
317 if v.externalIDs[task.Parent] {
318 continue
319 }
320 result.AddIssue(LevelError, task.ID, task.FilePath,
321 fmt.Sprintf("parent references non-existent task: '%s'", task.Parent))
322 }
323 }
324}
325
326// checkParentSelfReference warns if a task lists itself as parent
327func (v *Validator) checkParentSelfReference(tasks []*model.Task, result *ValidationResult) {

Callers 1

ValidateMethod · 0.95

Calls 1

AddIssueMethod · 0.80

Tested by

no test coverage detected