(tmp_path: Path)
| 362 | |
| 363 | |
| 364 | def test_precommit_cli_exit_codes(tmp_path: Path) -> None: |
| 365 | skill = _write_skill(tmp_path, "cli-skill") |
| 366 | runner = CliRunner() |
| 367 | |
| 368 | passed = runner.invoke( |
| 369 | cli, |
| 370 | ["precommit-run", "--min-score", "70", "quality", str(skill / "SKILL.md")], |
| 371 | ) |
| 372 | assert passed.exit_code == 0, passed.output |
| 373 | assert "PASS cli-skill quality" in passed.output |
| 374 | |
| 375 | failed = runner.invoke( |
| 376 | cli, |
| 377 | ["precommit-run", "--min-score", "100", "quality", str(skill / "SKILL.md")], |
| 378 | ) |
| 379 | assert failed.exit_code == 1, failed.output |
| 380 | assert "FAIL cli-skill quality" in failed.output |
| 381 | assert "(min 100)" in failed.output |
| 382 | |
| 383 | # pre-commit appends hook args after the entry, then filenames. |
| 384 | interleaved = runner.invoke( |
| 385 | cli, |
| 386 | ["precommit-run", "quality", "--min-score", "100", str(skill / "SKILL.md")], |
| 387 | ) |
| 388 | assert interleaved.exit_code == 1, interleaved.output |
| 389 | assert "(min 100)" in interleaved.output |
| 390 | |
| 391 | |
| 392 | def test_precommit_cli_maps_relative_paths_from_cwd(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None: |
nothing calls this directly
no test coverage detected