warnUnknownScope prints a warning to stderr if the scope pattern doesn't match any configured scope in .taskmd.yaml.
(scope string)
| 27 | // warnUnknownScope prints a warning to stderr if the scope pattern doesn't match |
| 28 | // any configured scope in .taskmd.yaml. |
| 29 | func warnUnknownScope(scope string) { |
| 30 | known := loadScopesConfig() |
| 31 | if known == nil { |
| 32 | return |
| 33 | } |
| 34 | |
| 35 | for name := range known { |
| 36 | if filter.MatchScope(scope, name) { |
| 37 | return |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | fmt.Fprintf(os.Stderr, "Warning: scope %q does not match any configured scope\n", scope) |
| 42 | } |
| 43 | |
| 44 | // loadScopesConfig reads the scopes map from .taskmd.yaml configuration. |
| 45 | func loadScopesConfig() map[string]bool { |
no test coverage detected