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

Method checkConfigScopes

sdk/go/validator/validator.go:460–471  ·  view source on GitHub ↗

checkConfigScopes validates each scope entry has a non-empty paths array.

(config *ConfigData, result *ValidationResult)

Source from the content-addressed store, hash-verified

458
459// checkConfigScopes validates each scope entry has a non-empty paths array.
460func (v *Validator) checkConfigScopes(config *ConfigData, result *ValidationResult) {
461 for name, scope := range config.Scopes {
462 label := scopeLabel(name, scope.Description)
463 if scope.Paths == nil {
464 result.AddIssue(LevelError, "", config.ConfigPath,
465 fmt.Sprintf("%s is missing required field: paths", label))
466 } else if len(scope.Paths) == 0 {
467 result.AddIssue(LevelError, "", config.ConfigPath,
468 fmt.Sprintf("%s has empty paths array", label))
469 }
470 }
471}
472
473// scopeLabel returns a formatted label like "scope 'name' (description)" or "scope 'name'".
474func scopeLabel(name, description string) string {

Callers 1

ValidateConfigMethod · 0.95

Calls 2

scopeLabelFunction · 0.85
AddIssueMethod · 0.80

Tested by

no test coverage detected