diff --git a/Makefile b/Makefile index 236a268..9f90dfb 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .PHONY: dev lint typecheck test complexity deps coverage security dep-age runbooks docs validate # Keep local core tests aligned with the required CI coverage selection. -CORE_TESTS := $(shell cat scripts/core-test-files.txt) +CORE_TESTS := $(shell grep -Ev '^[[:space:]]*\#|^[[:space:]]*$$' scripts/core-test-files.txt) # ─── Development Setup ────────────────────────────────────────── dev: .venv diff --git a/README.md b/README.md index 7b771e9..c500098 100644 --- a/README.md +++ b/README.md @@ -672,7 +672,7 @@ The [skills.sh catalog page](https://skills.sh/magnus919/agent-skills) is popula ### Repository validation -Contributors need Python 3.14+ and Ruby 2.6+ (the checked-in `.venv` uses the pinned development dependencies in `requirements-dev.txt`). Run the focused checks first, then the complete repository gate: +Contributors need Python 3.10+ and Ruby 2.6+ for local development. CI currently runs the validation workflow with Python 3.12 and Ruby 3.3; the checked-in `.venv` uses the pinned development dependencies in `requirements-dev.txt`. Run the focused checks first, then the complete repository gate: ```bash python3 scripts/check-catalog-set.py diff --git a/scripts/test_core_test_selection.py b/scripts/test_core_test_selection.py index d2e5f9a..81c9238 100644 --- a/scripts/test_core_test_selection.py +++ b/scripts/test_core_test_selection.py @@ -1,12 +1,14 @@ #!/usr/bin/env python3 """Ensure local and CI core test selections use the shared manifest.""" +import subprocess from pathlib import Path ROOT = Path(__file__).resolve().parent.parent MANIFEST = ROOT / "scripts" / "core-test-files.txt" MAKEFILE = ROOT / "Makefile" WORKFLOW = ROOT / ".github" / "workflows" / "validate.yml" +FILTER = "sed -e '/^[[:space:]]*#/d' -e '/^[[:space:]]*$/d'" def manifest_entries() -> list[str]: @@ -30,6 +32,26 @@ def test_makefile_consumes_shared_core_manifest() -> None: assert "$(CORE_TESTS)" in makefile +def test_makefile_filters_comments_and_blank_lines_like_ci() -> None: + makefile = MAKEFILE.read_text() + # Make doubles the dollar sign so the shell receives the same expression as CI. + assert "grep -Ev '^[[:space:]]*\\#|^[[:space:]]*$$'" in makefile + + +def test_make_and_ci_filtering_semantics_match() -> None: + sample = "# comment\n # indented comment\n\n scripts/example.py \n\t\n" + expected = ["scripts/example.py"] + filtered = subprocess.run( + ["sed", "-e", "/^[[:space:]]*#/d", "-e", "/^[[:space:]]*$/d"], + input=sample, + text=True, + capture_output=True, + check=True, + ).stdout.splitlines() + assert [line.strip() for line in filtered] == expected + assert FILTER in WORKFLOW.read_text() + + def test_required_ci_consumes_shared_core_manifest() -> None: workflow = WORKFLOW.read_text() assert "core-test-files.txt" in workflow