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

Function warnDuplicateIDs

apps/cli/internal/cli/duplicate.go:44–56  ·  view source on GitHub ↗

warnDuplicateIDs prints a warning to stderr if any duplicate IDs exist. Returns the duplicate map for callers that need it.

(tasks []*model.Task)

Source from the content-addressed store, hash-verified

42// warnDuplicateIDs prints a warning to stderr if any duplicate IDs exist.
43// Returns the duplicate map for callers that need it.
44func warnDuplicateIDs(tasks []*model.Task) map[string][]string {
45 dupes := findAllDuplicateIDs(tasks)
46 if len(dupes) == 0 {
47 return dupes
48 }
49
50 fmt.Fprintf(os.Stderr, "Warning: found duplicate task IDs:\n")
51 for id, paths := range dupes {
52 fmt.Fprintf(os.Stderr, " ID %q in %d files: %s\n", id, len(paths), strings.Join(paths, ", "))
53 }
54 fmt.Fprintf(os.Stderr, "Run 'taskmd deduplicate' to fix.\n")
55 return dupes
56}
57
58// formatDuplicatePaths formats task file paths as a bulleted list.
59func formatDuplicatePaths(tasks []*model.Task) string {

Callers 15

runNextFunction · 0.85
runTagsFunction · 0.85
runTracksFunction · 0.85
runBoardFunction · 0.85
runCommitMsgFunction · 0.85
runStatsFunction · 0.85
runSearchFunction · 0.85
runSnapshotFunction · 0.85
runVerifyFunction · 0.85
runNextIDFunction · 0.85
runGraphFunction · 0.85
TestWarnDuplicateIDsFunction · 0.85

Calls 1

findAllDuplicateIDsFunction · 0.85

Tested by 1

TestWarnDuplicateIDsFunction · 0.68