MCPcopy Create free account
hub / github.com/cli/cli / validateName

Function validateName

internal/skills/discovery/discovery.go:1089–1097  ·  view source on GitHub ↗

validateName checks if a skill name is safe for use (filesystem-safe).

(name string)

Source from the content-addressed store, hash-verified

1087
1088// validateName checks if a skill name is safe for use (filesystem-safe).
1089func validateName(name string) bool {
1090 if len(name) == 0 || len(name) > 64 {
1091 return false
1092 }
1093 if strings.Contains(name, "/") || strings.Contains(name, "..") {
1094 return false
1095 }
1096 return safeNamePattern.MatchString(name)
1097}
1098
1099// hasHiddenSegment reports whether any path component starts with a dot.
1100func hasHiddenSegment(p string) bool {

Callers 5

TestValidateNameFunction · 0.85
matchSkillConventionsFunction · 0.85
localSkillFromDirFunction · 0.85

Calls 1

ContainsMethod · 0.80

Tested by 1

TestValidateNameFunction · 0.68