checkMissingParent checks that parent references an existing task
(tasks []*model.Task, taskMap map[string]*model.Task, result *ValidationResult)
| 309 | |
| 310 | // checkMissingParent checks that parent references an existing task |
| 311 | func (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 |
| 327 | func (v *Validator) checkParentSelfReference(tasks []*model.Task, result *ValidationResult) { |