diff --git a/.claude/commands/ci.md b/.claude/commands/ci.md index 9c523db..c33d4c8 100644 --- a/.claude/commands/ci.md +++ b/.claude/commands/ci.md @@ -3,7 +3,7 @@ Run the full local CI pipeline for this Copier template repository and report re Execute `just ci` which runs in this order: 1. `just fix` — auto-fix ruff lint issues 2. `just fmt` — ruff formatting -3. `just ci-check` — read-only mirror of GitHub Actions, which runs: +3. `just check` — read-only mirror of GitHub Actions, which runs: - `uv sync --frozen --extra dev` - `just fmt-check` — verify formatting (read-only) - `ruff check .` — lint diff --git a/.claude/hooks/post-edit-copier-migration.sh b/.claude/hooks/post-edit-copier-migration.sh index 88a5059..48ab720 100755 --- a/.claude/hooks/post-edit-copier-migration.sh +++ b/.claude/hooks/post-edit-copier-migration.sh @@ -44,7 +44,7 @@ echo "│" echo "│ □ _migrations — add a migration block if renaming or removing a" echo "│ variable so existing generated projects can upgrade" echo "│" -echo "│ □ tests/test_template.py — add or update parametrized tests that cover" +echo "│ □ tests/integration/test_template.py — add or update parametrized tests that cover" echo "│ the new variable behaviour" echo "│" echo "│ □ CLAUDE.md — update 'Copier variable conventions' section if" diff --git a/.claude/rules/copier/template-conventions.md b/.claude/rules/copier/template-conventions.md index 1de0968..8c40e38 100644 --- a/.claude/rules/copier/template-conventions.md +++ b/.claude/rules/copier/template-conventions.md @@ -173,7 +173,7 @@ When adding or modifying hooks, commands, or rules: ## Testing template changes Every change to `copier.yml` or a template file requires a test update in -`tests/test_template.py`. Run: +`tests/integration/test_template.py`. Run: ```bash just test # run all template tests diff --git a/.claude/rules/jinja/testing.md b/.claude/rules/jinja/testing.md index 404b299..0f1feff 100644 --- a/.claude/rules/jinja/testing.md +++ b/.claude/rules/jinja/testing.md @@ -6,7 +6,7 @@ ## What to test -Every Jinja2 template change requires a corresponding test in `tests/test_template.py`. +Every Jinja2 template change requires a corresponding test in `tests/integration/test_template.py`. Tests render the template with `copier copy` and assert on the output. Scenarios to cover for each template file: @@ -82,7 +82,7 @@ rm -rf /tmp/test-output ## Update testing Test `copier update` scenarios when changing `_skip_if_exists` or the `.copier-answers.yml` -template. The `tests/test_template.py` file includes update scenario tests; add new ones +template. The `tests/integration/test_template.py` file includes update scenario tests; add new ones when you add new `_skip_if_exists` entries. ## Coverage for template branches diff --git a/.claude/rules/python/testing.md b/.claude/rules/python/testing.md index 887c1eb..176667d 100644 --- a/.claude/rules/python/testing.md +++ b/.claude/rules/python/testing.md @@ -21,6 +21,39 @@ tests/ └── test_imports.py # smoke test: every public symbol is importable ``` +### Meta-repo (this template repository) + +Generated projects follow the layout above. **This Copier meta-repository** has no `src/` tree; +Python under test lives in `scripts/`. Keep pytest modules organized as: + +``` +tests/ +├── conftest.py # top-level shared fixtures +├── unit/ +│ ├── conftest.py +│ └── test_