checkDuplicateIDs checks for duplicate task IDs
(tasks []*model.Task, result *ValidationResult)
| 211 | |
| 212 | // checkDuplicateIDs checks for duplicate task IDs |
| 213 | func (v *Validator) checkDuplicateIDs(tasks []*model.Task, result *ValidationResult) { |
| 214 | seen := make(map[string][]string) // ID -> file paths |
| 215 | |
| 216 | for _, task := range tasks { |
| 217 | if task.ID == "" { |
| 218 | continue // Skip, already reported in checkRequiredFields |
| 219 | } |
| 220 | seen[task.ID] = append(seen[task.ID], task.FilePath) |
| 221 | } |
| 222 | |
| 223 | for id, paths := range seen { |
| 224 | if len(paths) > 1 { |
| 225 | result.AddIssue(LevelError, id, strings.Join(paths, ", "), |
| 226 | fmt.Sprintf("duplicate task ID '%s' found in %d files", id, len(paths))) |
| 227 | } |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | // checkMissingDependencies checks for references to non-existent tasks |
| 232 | func (v *Validator) checkMissingDependencies(tasks []*model.Task, taskMap map[string]*model.Task, result *ValidationResult) { |