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

Function skippedBy

script/ghmock/gqlscaffold.go:348–356  ·  view source on GitHub ↗

skippedBy evaluates @skip and @include with the variables gh sent.

(dirs ast.DirectiveList, vars map[string]any)

Source from the content-addressed store, hash-verified

346
347// skippedBy evaluates @skip and @include with the variables gh sent.
348func skippedBy(dirs ast.DirectiveList, vars map[string]any) bool {
349 if d := dirs.ForName("skip"); d != nil && condition(d, vars) {
350 return true
351 }
352 if d := dirs.ForName("include"); d != nil && !condition(d, vars) {
353 return true
354 }
355 return false
356}
357
358func condition(d *ast.Directive, vars map[string]any) bool {
359 arg := d.Arguments.ForName("if")

Callers 2

collectMethod · 0.85
skippedMethod · 0.85

Calls 1

conditionFunction · 0.85

Tested by

no test coverage detected