MCPcopy Index your code
hub / github.com/cli/cli / validateName

Function validateName

internal/skills/discovery/discovery.go:1039–1047  ·  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

1037
1038// validateName checks if a skill name is safe for use (filesystem-safe).
1039func validateName(name string) bool {
1040 if len(name) == 0 || len(name) > 64 {
1041 return false
1042 }
1043 if strings.Contains(name, "/") || strings.Contains(name, "..") {
1044 return false
1045 }
1046 return safeNamePattern.MatchString(name)
1047}
1048
1049// hasHiddenSegment reports whether any path component starts with a dot.
1050func 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