You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 99902c0
Browse filesBrowse the repository at this point in the historyBrowse files
Patternizer is a Go CLI tool that bootstraps Git repositories containing Helm charts into ready-to-use Validated Patterns. Module path: `github.com/validatedpatterns/patternizer`.
4
+
5
+
## Build, Lint, and Test
6
+
7
+
Run `make dev-setup` once to install tooling (golangci-lint, ginkgo).
8
+
9
+
Key make targets:
10
+
11
+
-`make ci` - Full CI pipeline: lint, build, test. Run this before considering any change complete.
12
+
-`make build` - Build the binary.
13
+
-`make test` - Run all tests via Ginkgo.
14
+
-`make lint` - Run all linters (gofmt, go vet, golangci-lint).
15
+
-`make fmt` - Auto-format Go code.
16
+
-`make check` - Quick check: format, vet, build, unit tests.
17
+
18
+
All Go source lives under `src/`. The Makefile handles `cd src` automatically.
19
+
20
+
## Code Style
21
+
22
+
- No unnecessary inline comments. Code should be self-documenting through clear naming and structure.
23
+
- No emojis, ASCII art, or non-standard characters anywhere in the codebase.
24
+
- Exported functions must have godoc comments (enforced by the revive linter).
25
+
- Run `make fmt` before committing. Formatting is checked by `make lint`.
-`src/internal/embedded/` - Embedded resources via `go:embed`.
31
+
32
+
## Go Best Practices
33
+
34
+
- Wrap errors with context: `fmt.Errorf("description: %w", err)`.
35
+
- Break large functions into smaller, well-named helper functions. Each function should do one thing.
36
+
- Keep `main.go` minimal; delegate to `cmd.Execute()`.
37
+
- Use `internal/` to keep implementation details private.
38
+
- Use `go:embed` for bundled resources (see `internal/embedded/`).
39
+
- CLI commands use Cobra. Add new commands by registering them on `rootCmd` in `cmd/root.go`.
40
+
41
+
## Testing
42
+
43
+
- Tests must be added or updated when writing new code.
44
+
- The project uses Ginkgo v2 and Gomega (BDD style: `Describe`/`Context`/`It`).
45
+
- Test files live alongside source files as `*_test.go`.
46
+
- Each package with tests needs a `*_suite_test.go` file for Ginkgo bootstrap.
47
+
- Use `GinkgoT().TempDir()` for temporary directories in tests.
48
+
- Run `make test` to execute all tests (`ginkgo -v ./...`).
49
+
50
+
## Versioning
51
+
52
+
The project version is tracked in the shield badge on line 1 of `README.md` (e.g. ``). Bump it once per session or PR when the CLI binary changes:
0 commit comments