MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / match

Function match

pre_commit/yaml_rewrite.py:48–52  ·  view source on GitHub ↗
(n: Node, matcher: tuple[_Matcher, ...])

Source from the content-addressed store, hash-verified

46
47
48def match(n: Node, matcher: tuple[_Matcher, ...]) -> Generator[ScalarNode]:
49 gen: Iterable[Node] = (n,)
50 for m in matcher:
51 gen = _match(gen, m)
52 return (n for n in gen if isinstance(n, ScalarNode))

Callers 2

_migrate_composedFunction · 0.90

Calls 1

_matchFunction · 0.85

Tested by 1