From a8d5f205db092b03fe2a684c1ad76b26be8b3dc3 Mon Sep 17 00:00:00 2001 From: ArthurErlich Date: Sat, 30 May 2026 14:14:38 +0200 Subject: [PATCH] docs: fix typos and reformat tables in CLAUDE.md Fix "Prever" typo, add Windows WSL test runner command, and align Markdown table columns for readability. Co-Authored-By: Claude Sonnet 4.6 --- CLAUDE.md | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 041db57..6e7769a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -76,15 +76,16 @@ Run vendor/bin/phpunit after each change to confirm tests stay green. **Common anti-patterns** -| Wrong prompt | Why it breaks TDD | Correct prompt | -|---|---|---| -| "Write tests for this feature" | Claude implements first, then fits tests to it | "Write **failing** tests for [feature]. Stop before any implementation." | -| "Add tests and implementation" | Loses the design feedback of failing tests | Two separate prompts: Red, then Green | -| "Make the tests pass" | Encourages skipping to a green state | "Implement the minimum to make the failing tests pass." | -| Combining Red + Green in one request | No failing baseline | Always separate the two phases | +| Wrong prompt | Why it breaks TDD | Correct prompt | +| ------------------------------------ | ---------------------------------------------- | ------------------------------------------------------------------------ | +| "Write tests for this feature" | Claude implements first, then fits tests to it | "Write **failing** tests for [feature]. Stop before any implementation." | +| "Add tests and implementation" | Loses the design feedback of failing tests | Two separate prompts: Red, then Green | +| "Make the tests pass" | Encourages skipping to a green state | "Implement the minimum to make the failing tests pass." | +| Combining Red + Green in one request | No failing baseline | Always separate the two phases | ### Running tests -Prever to use the tests in `docker compose exec graph` + +Prefer to use the tests in `docker compose exec graph` ```bash # Run full suite @@ -100,6 +101,12 @@ vendor/bin/phpunit tests/Unit/Service/SvgRendererTest.php vendor/bin/phpunit --filter it_renders ``` +On Windows, run via WSL (If Docker Desctop is not): + +```powershell +wsl -e bash -c "cd /mnt/g/_DEV/repos/git-contribution-graph && docker compose exec graph vendor/bin/phpunit --testdox 2>&1" +``` + ### Auto-run hook Add to `.claude/settings.json` to run PHPUnit automatically after every file edit: @@ -131,8 +138,8 @@ Workflow files live in [.gitea/workflows/](.gitea/workflows/). This project uses **Current workflows:** -| File | Trigger | Purpose | -|---|---|---| +| File | Trigger | Purpose | +| -------------------- | ---------------- | --------------------------------------------------------- | | `docker-publish.yml` | Push tag `*.*.*` | Build & push multi-arch image to Gitea container registry | ## Docker @@ -209,13 +216,13 @@ GET /graph.svg?theme=dark|light ## Environment variables -| Variable | Required | Notes | -|---|---|---| -| `APP_SECRET` | Yes | 32+ char random string | -| `GITHUB_USER` / `GITHUB_TOKEN` | For GitHub | Token scope: `read:user` | -| `GITLAB_USER` / `GITLAB_TOKEN` | For GitLab | Token scopes: `read_user`, `read_api` | -| `GITLAB_URL` | No | Defaults to `https://gitlab.com` | -| `GITEA_USER` / `GITEA_TOKEN` / `GITEA_URL` | For Gitea | Token scope: `read:user` | -| `ALLOWED_HOSTS` | No | Comma-separated hostnames; empty = allow all | +| Variable | Required | Notes | +| ------------------------------------------ | ---------- | -------------------------------------------- | +| `APP_SECRET` | Yes | 32+ char random string | +| `GITHUB_USER` / `GITHUB_TOKEN` | For GitHub | Token scope: `read:user` | +| `GITLAB_USER` / `GITLAB_TOKEN` | For GitLab | Token scopes: `read_user`, `read_api` | +| `GITLAB_URL` | No | Defaults to `https://gitlab.com` | +| `GITEA_USER` / `GITEA_TOKEN` / `GITEA_URL` | For Gitea | Token scope: `read:user` | +| `ALLOWED_HOSTS` | No | Comma-separated hostnames; empty = allow all | Copy `.env` to `.env.local` for local development — `.env.local` is gitignored.