on main help sign in
docs(crush.md): add more specific Go formatting instructions
commit41f97bc80e04a89ac84cc2db5f4391ba12d92aaf authorChristian Rocha <christian@rocha.is> dateWed 25 Jun 2025, 17:17 (1 year ago) parentaf72204
1 file changed+11
CRUSH.md+11
CRUSH.md+11
@@ -1,6 +1,7 @@
11# Crush Development Guide
22
33## Build/Test/Lint Commands
4+
45- **Build**: `go build .` or `go run .`
56- **Test**: `task test` or `go test ./...` (run single test: `go test ./internal/llm/prompt -run TestGetContextFromPaths`)
67- **Lint**: `task lint` (golangci-lint run) or `task lint-fix` (with --fix)
@@ -8,6 +9,7 @@
89- **Dev**: `task dev` (runs with profiling enabled)
910
1011## Code Style Guidelines
12+
1113- **Imports**: Use goimports formatting, group stdlib, external, internal packages
1214- **Formatting**: Use gofumpt (stricter than gofmt), enabled in golangci-lint
1315- **Naming**: Standard Go conventions - PascalCase for exported, camelCase for unexported
@@ -21,3 +23,12 @@
2123- **JSON tags**: Use snake_case for JSON field names
2224- **File permissions**: Use octal notation (0o755, 0o644) for file permissions
2325- **Comments**: End comments in periods unless comments are at the end of the line.
26+
27+## Formatting
28+
29+- ALWAYS format any Go code you write.
30+ - First, try `goftumpt -w .`.
31+ - If `gofumpt` is not available, use `goimports`.
32+ - If `goimports` is not available, use `gofmt`.
33+ - You can also use `task fmt` to run `gofumpt -w .` on the entire project,
34+ as long as `gofumpt` is on the `PATH`.