filterTasksByScope returns tasks whose touches field matches the given scope pattern.
(tasks []*model.Task, scope string)
| 12 | |
| 13 | // filterTasksByScope returns tasks whose touches field matches the given scope pattern. |
| 14 | func 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. |
no outgoing calls