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

Function filterTasksByScope

apps/cli/internal/cli/scope_filter.go:14–25  ·  view source on GitHub ↗

filterTasksByScope returns tasks whose touches field matches the given scope pattern.

(tasks []*model.Task, scope string)

Source from the content-addressed store, hash-verified

12
13// filterTasksByScope returns tasks whose touches field matches the given scope pattern.
14func filterTasksByScope(tasks []*model.Task, scope string) []*model.Task {
15 var filtered []*model.Task
16 for _, task := range tasks {
17 for _, t := range task.Touches {
18 if filter.MatchScope(scope, t) {
19 filtered = append(filtered, task)
20 break
21 }
22 }
23 }
24 return filtered
25}
26
27// warnUnknownScope prints a warning to stderr if the scope pattern doesn't match
28// any configured scope in .taskmd.yaml.

Callers 2

applyShortcutFiltersFunction · 0.85
TestFilterTasksByScopeFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestFilterTasksByScopeFunction · 0.68