Skip to content

Commit 8f258a3

Browse files
authored
Add a justfile (#5490)
Just (https://just.systems/) works better than make for running commands. For example, passing arguments to `make integration-test-cli` requires a `--` between make's arguments and the cli test runner's arguments (e.g. -sandbox), and will also result in weird errors. Just doesn't have any of these problems. I chose different target names than we use in the Makefile; the goal is to have better tab completion, where the most commonly used commands can be completed after typing a single letter. That's why I use "e2e" for integration tests, which is not a term we use anywhere else. Keeping the Makefile around for those who are used to it, and are too lazy to install just.
2 parents 84b7d1e + 665fcbf commit 8f258a3

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

justfile

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
default:
2+
just --list
3+
4+
# Build lazygit with optimizations disabled (to make debugging easier).
5+
build:
6+
go build -gcflags='all=-N -l'
7+
8+
install:
9+
go install
10+
11+
run: build
12+
./lazygit
13+
14+
# Run `just debug` in one terminal tab and `just print-log` in another to view the program and its log output side by side
15+
debug: build
16+
./lazygit -debug
17+
18+
print-log: build
19+
./lazygit --logs
20+
21+
unit-test:
22+
go test ./... -short
23+
24+
# Run both unit tests and integration tests.
25+
test: unit-test e2e-all
26+
27+
# Generate all our auto-generated files (test list, cheatsheets, json schema, maybe other things in the future)
28+
generate:
29+
go generate ./...
30+
31+
format:
32+
gofumpt -l -w .
33+
34+
lint:
35+
./scripts/golangci-lint-shim.sh run
36+
37+
# Run integration tests with a visible UI. Most useful for running a single test; for running all tests, use `e2e-all` instead.
38+
e2e *args:
39+
go run cmd/integration_test/main.go cli {{ args }}
40+
41+
# Open the TUI for running integration tests.
42+
e2e-tui *args:
43+
go run cmd/integration_test/main.go tui {{ args }}
44+
45+
# Run all integration tests headlessly (without a visible UI).
46+
e2e-all:
47+
go test pkg/integration/clients/*.go
48+
49+
bump-gocui:
50+
scripts/bump_gocui.sh
51+
52+
# Record a demo
53+
demo *args:
54+
demo/record_demo.sh {{ args }}
55+
56+
vendor:
57+
go mod vendor && go mod tidy

0 commit comments

Comments
 (0)