(base: str)
| 165 | |
| 166 | |
| 167 | def cmd_check(base: str) -> int: |
| 168 | violations = [] |
| 169 | for pj in changed_plugins(base, staged_only=False): |
| 170 | work = working_version(pj) |
| 171 | bv = base_version(base, pj) |
| 172 | if not is_ahead(work, bv): |
| 173 | violations.append( |
| 174 | f"{rel(plugin_root(pj))}: changed but version not bumped " |
| 175 | f"({bv} -> {work}). Bump .claude-plugin/plugin.json version " |
| 176 | f"(or run scripts/check.py once to install the pre-commit hook)." |
| 177 | ) |
| 178 | if violations: |
| 179 | print( |
| 180 | f"FAIL — {len(violations)} plugin(s) changed without a version bump:\n", |
| 181 | file=sys.stderr, |
| 182 | ) |
| 183 | for v in violations: |
| 184 | print(f" ✗ {v}", file=sys.stderr) |
| 185 | return 1 |
| 186 | print("OK — all changed plugins have a version bump.") |
| 187 | return 0 |
| 188 | |
| 189 | |
| 190 | def main() -> int: |
no test coverage detected