(tmp_path: Path)
| 237 | |
| 238 | |
| 239 | def test_precommit_schema_exit_codes(tmp_path: Path) -> None: |
| 240 | valid = _write_skill(tmp_path, "valid-skill") |
| 241 | invalid = _write_skill( |
| 242 | tmp_path, |
| 243 | "broken-skill", |
| 244 | body="# Broken\n\nNo frontmatter.\n", |
| 245 | ) |
| 246 | |
| 247 | code, lines = run_precommit("schema", [str(valid / "SKILL.md")], cwd=tmp_path) |
| 248 | assert code == 0 |
| 249 | assert lines == ["PASS valid-skill schema"] |
| 250 | |
| 251 | code, lines = run_precommit("schema", [str(invalid / "SKILL.md")], cwd=tmp_path) |
| 252 | assert code == 1 |
| 253 | assert lines[0].startswith("FAIL broken-skill schema ") |
| 254 | |
| 255 | |
| 256 | def test_precommit_lint_scripts_is_advisory_pass(tmp_path: Path) -> None: |
nothing calls this directly
no test coverage detected