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

Method checkDuplicateIDs

sdk/go/validator/validator.go:213–229  ·  view source on GitHub ↗

checkDuplicateIDs checks for duplicate task IDs

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

Source from the content-addressed store, hash-verified

211
212// checkDuplicateIDs checks for duplicate task IDs
213func (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
232func (v *Validator) checkMissingDependencies(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