MCPcopy
hub / github.com/anthropics/financial-services / changed_plugins

Function changed_plugins

scripts/version_bump.py:129–145  ·  view source on GitHub ↗

Plugin roots touched relative to base (staged set, or base...HEAD).

(base: str, staged_only: bool)

Source from the content-addressed store, hash-verified

127
128
129def changed_plugins(base: str, staged_only: bool) -> list[Path]:
130 """Plugin roots touched relative to base (staged set, or base...HEAD)."""
131 if staged_only:
132 files = git_ok("diff", "--cached", "--name-only") or ""
133 else:
134 files = git_ok("diff", "--name-only", f"{base}...HEAD") or ""
135 changed = {Path(line) for line in files.splitlines() if line}
136
137 hits: list[Path] = []
138 for pj in all_plugin_jsons():
139 root_rel = Path(rel(plugin_root(pj)))
140 if any(
141 c == root_rel or root_rel in c.parents or str(c).startswith(f"{root_rel}/")
142 for c in changed
143 ):
144 hits.append(pj)
145 return hits
146
147
148def cmd_apply(base: str) -> int:

Callers 2

cmd_applyFunction · 0.85
cmd_checkFunction · 0.85

Calls 4

git_okFunction · 0.85
all_plugin_jsonsFunction · 0.85
plugin_rootFunction · 0.85
relFunction · 0.70

Tested by

no test coverage detected