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

Method checkParentSelfReference

sdk/go/validator/validator.go:327–334  ·  view source on GitHub ↗

checkParentSelfReference warns if a task lists itself as parent

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

Source from the content-addressed store, hash-verified

325
326// checkParentSelfReference warns if a task lists itself as parent
327func (v *Validator) checkParentSelfReference(tasks []*model.Task, result *ValidationResult) {
328 for _, task := range tasks {
329 if task.Parent != "" && task.Parent == task.ID {
330 result.AddIssue(LevelWarning, task.ID, task.FilePath,
331 "task references itself as parent")
332 }
333 }
334}
335
336// checkParentCycles detects cycles in the parent chain (e.g. A→B→A)
337func (v *Validator) checkParentCycles(tasks []*model.Task, taskMap map[string]*model.Task, result *ValidationResult) {

Callers 1

ValidateMethod · 0.95

Calls 1

AddIssueMethod · 0.80

Tested by

no test coverage detected