v0.1.0 709e2cd

Makefile RawHistoryFolder

1.PHONY: bin build test vet race mod-check mocks mocks-check fakes-check arch perf-check check
2
3GOBIN_DIR := $(or $(shell go env GOBIN),$(firstword $(subst :, ,$(shell go env GOPATH)))/bin)
4MOCKERY ?= $(GOBIN_DIR)/mockery
5HEXCHECK ?= $(GOBIN_DIR)/hexcheck
6
7# Build a fresh binary.
8bin:
9	CGO_ENABLED=0 go build -o bin/nefercap ./cmd/nefercap
10build:
11	CGO_ENABLED=0 go build ./...
12test:
13	CGO_ENABLED=0 go test ./...
14vet:
15	CGO_ENABLED=0 go vet ./...
16race:
17	# cgo is enabled only for the race test binary.
18	CGO_ENABLED=1 go test -race ./...
19# go.mod and go.sum must be tidy (prints the diff and fails otherwise).
20mod-check:
21	go mod tidy -diff
22
23# Regenerate from scratch so mocks of removed interfaces disappear too.
24mocks:
25	@test -x '$(MOCKERY)' || { echo 'mockery not found or not executable: $(MOCKERY)' >&2; exit 1; }
26	rm -rf internal/mocks
27	find internal -name '*_mock_test.go' -delete
28	$(MOCKERY)
29
30MOCKS := internal/mocks ':(glob)internal/**/*_mock_test.go'
31# Regenerate, then require the mocks to be tracked and unchanged.
32mocks-check: mocks
33	git diff --exit-code -- $(MOCKS)
34	@test -z "$$(git ls-files --others --exclude-standard -- $(MOCKS))" || { echo 'untracked generated mocks: commit them' >&2; exit 1; }
35
36# Test doubles come from Mockery only: no handwritten fake/stub/spy types.
37# grep exit 1 (no match) passes; 0 (match) and 2 (error) fail.
38FAKES := ^\s*type\s+\w*(fake|stub|spy|dummy|mock)\w*|^\s*\w*(fake|stub|spy|dummy|mock)\w*(\[[^]]*\])?\s+(struct|interface)\b
39fakes-check:
40	@dirs=$$(ls -d internal cmd 2>/dev/null); [ -n "$$dirs" ] || exit 0; \
41	rc=0; grep -rniE '$(FAKES)' --include='*_test.go' --exclude='*_mock_test.go' $$dirs || rc=$$?; \
42	[ $$rc -eq 1 ] || { [ $$rc -eq 0 ] && echo 'handwritten test double: add an interface and a Mockery entry (see AGENTS.md)' >&2; exit 1; }
43arch:
44	$(HEXCHECK) -hexcheck.config .hexcheck.yaml -hexcheck.root . ./...
45# Steady-state allocation guards. PERF_TESTS lists exact test names and PERF_PKGS
46# the packages holding them. Every named test must exist, so the guard cannot
47# pass vacuously when a frame-path test is removed or renamed.
48PERF_TESTS := TestFrameAllocations TestSelectionAllocations TestPickerAllocations TestMonitorGridAllocations TestMonitorGridPhysicalAllocations TestGridAllocations TestGridModeAllocations TestSelectorAllocations TestModeToggleAllocations TestRefreshAllocations TestVideoRowsAllocations TestWriteSteadyStateAllocations TestResolveOutputAllocations TestCaptureAllocations
49PERF_PKGS := ./internal/ports ./internal/core ./internal/adapters/selection ./internal/adapters/indicator ./internal/adapters/ffmpeg ./internal/app ./internal/adapters/wayland
50perf_empty :=
51perf_space := $(perf_empty) $(perf_empty)
52PERF_RE := ^($(subst $(perf_space),|,$(strip $(PERF_TESTS))))$$
53perf-check:
54	@out=$$(CGO_ENABLED=0 go test -list '$(PERF_RE)' $(PERF_PKGS)) || { echo "$$out" >&2; exit 1; }; \
55	for t in $(PERF_TESTS); do \
56		printf '%s\n' "$$out" | grep -qx "$$t" || { echo "perf-check: test $$t not found in $(PERF_PKGS)" >&2; exit 1; }; \
57	done
58	CGO_ENABLED=0 go test $(PERF_PKGS) -run '$(PERF_RE)' -count=1
59check: mod-check vet test arch fakes-check perf-check

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 2

Tags 9

↑↓ moveenter openesc close