cmd/rdir/main.goholds the CLI entrypoint and wires the TUI loop.internal/contains the core reducers, fuzzy search, and platform glue; unit and integration tests live beside their packages (seeinternal/state/fuzzy_integration_test.go).build/rdiris the generated binary; it stays out of version control via.gitignore.temp/is gitignored scratch space for temporary scripts, data, or experiments.docs/provides deeper reference material such asdocs/TEST_GUIDE.mdanddocs/IMPLEMENTATION.md.scripts/make.ps1captures the supported workflows for Windows/macOS/Linux (run./scripts/make.ps1 <target>). A GNU Makefile is kept for compatibility but is not the primary entrypoint.
- Use
./scripts/make.ps1 <target>for builds/tests/benchmarks; targets mirror the Makefile for users who still invokemake. ./scripts/make.ps1 buildcompiles the binary tobuild/rdir;./scripts/make.ps1 runrebuilds and launches it locally../scripts/make.ps1 testruns the full suite in./internal/...; usetest-coverageandtest-racetargets for coverage and race checks../scripts/make.ps1 checkruns lint, builds the binary, and compiles tests without executing them (go test -run '^$' ./internal/...)../scripts/make.ps1 bench-fuzzybenchmarks the fuzzy matchers; run it before and after algorithm changes to confirm deltas../scripts/make.ps1 fmtappliesgo fmt ./...;./scripts/make.ps1 lintshells togolangci-lint run ./...(install it locally first).
- Follow idiomatic Go: tabs for indentation,
camelCasefor locals,PascalCasefor exported identifiers, and_test.gosuffixes for test files. - New packages should sit under
internal/and expose only the minimum public surface; name directories after their domain (internal/global_search, etc.) when splitting grows necessary. - Run
make fmt(and optionallygolangci-lint run ./...) before sending changes to keep imports and formatting consistent.
- Prefer table-driven tests and subtests as shown in
internal/state/reducer_test.go; mirror production file names to keep coverage obvious. - Integration flows belong in
*_integration_test.go; gate expensive cases with short timeouts so they pass on CI. - Keep existing coverage steady; if coverage dips, add focused tests or reroute logic through existing suites.
- Write imperative, scope-first commit messages (e.g.,
Speed up gitignore matching,Reuse async walk buffers); keep the summary under 72 characters. - Each PR should include: a plain-language summary, any relevant
docs/updates, links to tracking issues, and output snippets formake test(andmake lintwhen applicable). - Before requesting review, ensure the working tree is clean, binaries are ignored, and benchmarks or race tests have been run for performance-sensitive changes.