MCPcopy Create free account
hub / github.com/github/gh-aw / validate

Method validate

pkg/workflow/glob_validation.go:186–209  ·  view source on GitHub ↗
(pat string)

Source from the content-addressed store, hash-verified

184}
185
186func (v *globValidator) validate(pat string) {
187 v.init(pat)
188 if pat == "" {
189 v.error("glob pattern cannot be empty")
190 return
191 }
192 switch v.scan.Peek() {
193 case '/':
194 if v.isRef {
195 v.scan.Next()
196 v.invalidRefChar('/', "ref name must not start with /")
197 v.prec = true
198 }
199 case '!':
200 v.scan.Next()
201 if v.scan.Peek() == scanner.EOF {
202 v.unexpected('!', "! at first character (negate pattern)", "at least one character must follow !")
203 return
204 }
205 v.prec = false
206 }
207 for v.validateNext() {
208 }
209}
210
211func runGlobValidation(pat string, isRef bool) []invalidGlobPattern {
212 v := globValidator{}

Calls 5

initMethod · 0.95
errorMethod · 0.95
invalidRefCharMethod · 0.95
unexpectedMethod · 0.95
validateNextMethod · 0.95