mirror of
https://github.com/rjNemo/underscore
synced 2026-06-06 02:26:42 +00:00
- Add Tap: for side effects/debugging in pipelines - Add Transpose: flip matrix rows and columns - Add Unzip: split tuple slice into two slices - Add ParallelReduce: parallel reduction (experimental) - Add Replicate: create n copies of a value Comprehensive tests included for all functions. Resolves Issues 21, 22, 23, 24, 25 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2 KiB
2 KiB
Repository Guidelines
Project Structure & Module Organization
- Source: package
underscorein repo root (*.go). - Tests: co-located
*_test.gofiles in root; examples inexamples/. - Module:
github.com/rjNemo/underscore(Go 1.24+). - Docs: Hugo site under
docs/(content, themes, public). - CI/Security assets: Dockerfile(s),
.golangci.yml,.trivycache/.
Build, Test, and Development Commands
go mod download: fetch dependencies for local dev.go test ./...: run unit tests locally.make build: build Docker imageunderscore:latest.make test: run tests in Docker with coverage summary.make docs: serve docs locally (cd docs && hugo server -D).make build-docs: build static docs site.make scan/make scan-config: security scan with Trivy (image/config).
Coding Style & Naming Conventions
- Formatting:
gofmt/goimports(enforced viagolangci-lint). - Lint:
golangci-lint run(uses.golangci.yml). - Indentation: tabs; idiomatic Go style.
- Naming: exported APIs use PascalCase (e.g.,
Filter,Map); files are lower_snake (filter.go). - Imports: group stdlib/external/local; local prefix
github.com/rjNemo/underscore.
Testing Guidelines
- Frameworks: Go
testingwithtestifyassertions. - Conventions:
TestXxxfunctions; prefer table-driven tests. - Coverage: keep or increase overall coverage;
make testprints summary. - Run subset:
go test ./... -run TestFilterfor focused runs.
Commit & Pull Request Guidelines
- Commits: imperative, concise subject; include scope when helpful.
- Before PR:
golangci-lint runandmake testmust pass. - PRs: clear description, linked issues, tests for new/changed behavior, update README/docs when API changes.
- Reviews: follow CONTRIBUTING; require two approvals before merge.
Security & Configuration Tips
- Go 1.24+ recommended; Docker image pins Go 1.24.
- Do not commit secrets; prefer environment variables for local runs.
- Use
make scanregularly; fix CRITICAL findings before release.