From a126063aeeebd9ce4560f4679a5a1a38c01204b7 Mon Sep 17 00:00:00 2001 From: Snider Date: Mon, 2 Feb 2026 15:38:55 +0000 Subject: [PATCH] chore: add implementation plan for issue 258 --- .core/task/issue/258/plan.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .core/task/issue/258/plan.md diff --git a/.core/task/issue/258/plan.md b/.core/task/issue/258/plan.md new file mode 100644 index 0000000..cb3a3dd --- /dev/null +++ b/.core/task/issue/258/plan.md @@ -0,0 +1,33 @@ +# Implementation Plan: Issue 258 + +## Phase 1: Command Structure +1. Create `cmd/core/cmd/test.go` +2. Register `test` command with Cobra +3. Add flags: `--all`, `--filter`, `--coverage` + +## Phase 2: Change Detection +1. Run `git diff --name-only HEAD` to get changed files +2. Filter for `.go` files (exclude `_test.go`) +3. Map each file to its test file: + - `internal/foo/bar.go` → `internal/foo/bar_test.go` + - Skip if test file does not exist + +## Phase 3: Test Execution +1. Build `go test` command with detected test files +2. Pass through `--coverage` flag as `-cover` +3. Pass through `--filter` as `-run` pattern +4. Stream output to terminal + +## Phase 4: Edge Cases +- No changed files → inform user, optionally run all +- No matching test files → inform user +- `--all` flag → skip detection, run `go test ./...` + +## Files to Create/Modify +- `cmd/core/cmd/test.go` (new) +- `cmd/core/cmd/root.go` (register command) + +## Testing +- Add `cmd/core/cmd/test_test.go` with unit tests +- Manual testing with actual git changes +