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

Method Validate

sdk/go/validator/validator.go:111–139  ·  view source on GitHub ↗

Validate performs all validation checks on a set of tasks

(tasks []*model.Task)

Source from the content-addressed store, hash-verified

109
110// Validate performs all validation checks on a set of tasks
111func (v *Validator) Validate(tasks []*model.Task) *ValidationResult {
112 result := &ValidationResult{
113 Issues: make([]ValidationIssue, 0),
114 TaskCount: len(tasks),
115 }
116
117 // Build task ID map for lookups
118 taskMap := make(map[string]*model.Task)
119 for _, task := range tasks {
120 taskMap[task.ID] = task
121 }
122
123 // Run validation checks
124 v.checkRequiredFields(tasks, result)
125 v.checkInvalidFieldValues(tasks, result)
126 v.checkDuplicateIDs(tasks, result)
127 v.checkMissingDependencies(tasks, taskMap, result)
128 v.checkCircularDependencies(tasks, taskMap, result)
129 v.checkMissingParent(tasks, taskMap, result)
130 v.checkParentSelfReference(tasks, result)
131 v.checkParentCycles(tasks, taskMap, result)
132
133 // Strict mode additional checks
134 if v.strict {
135 v.checkStrictWarnings(tasks, result)
136 }
137
138 return result
139}
140
141// checkRequiredFields validates that tasks have required fields
142func (v *Validator) checkRequiredFields(tasks []*model.Task, result *ValidationResult) {

Calls 9

checkRequiredFieldsMethod · 0.95
checkDuplicateIDsMethod · 0.95
checkMissingParentMethod · 0.95
checkParentCyclesMethod · 0.95
checkStrictWarningsMethod · 0.95