-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathJustfile
More file actions
102 lines (82 loc) · 2.15 KB
/
Copy pathJustfile
File metadata and controls
102 lines (82 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# braindump justfile
RELEASE := "build/release"
# Default recipe to display help
default:
@just --list
# Build the braindump binary
build:
go build -o braindump ./cmd/braindump
# Build with version information
build-release version:
go build -ldflags="-X main.Version={{version}}" -o {{RELEASE}}/braindump ./cmd/braindump
# Run all tests
test:
go test ./...
# Run tests with verbose output
test-verbose:
go test -v ./...
# Run tests with coverage
test-coverage:
go test -cover ./...
# Generate coverage report
coverage:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
@echo "Coverage report generated: coverage.html"
# Lint code using golangci-lint
lint:
golangci-lint run ./...
# Format code
fmt:
go fmt ./...
# Check if code is formatted
fmt-check:
@if [ -n "$$(gofmt -l .)" ]; then \
echo "The following files are not formatted:"; \
gofmt -l .; \
exit 1; \
fi
# Run go vet
vet:
go vet ./...
# Run all checks (fmt, vet, lint, test)
check: fmt-check vet lint test
# Clean build artifacts
clean:
rm -f braindump
rm -f coverage.out coverage.html
# Install dependencies
deps:
go mod download
go mod tidy
# Run the tool with pretty output
run *args:
go run ./cmd/braindump {{args}}
# Run the tool with example filters
demo:
@echo "=== All Claude sessions ==="
go run ./cmd/braindump --agent claude --pretty | head -50
@echo ""
@echo "=== Session count ==="
go run ./cmd/braindump | jq '.sessions | length'
# Install the binary to $GOPATH/bin
install:
go install ./cmd/braindump
# Show project statistics
stats:
@echo "=== Code Statistics ==="
@echo "Go files:"
@find . -name "*.go" | wc -l
@echo "Lines of code:"
@find . -name "*.go" -exec cat {} \; | wc -l
@echo ""
@echo "=== Test Coverage ==="
@go test -cover ./... 2>/dev/null | grep coverage || echo "Run 'just test-coverage' for details"
# Watch for changes and run tests
watch:
#!/usr/bin/env bash
while true; do
inotifywait -e modify -r . --include '.*\.go$' 2>/dev/null
clear
just test
done